# List Variable - Mapping to an Excel File cell

**URL:** <https://forum.katalon.com/t/list-variable-mapping-to-an-excel-file-cell/20825>\
**Category:** Web Testing\
**Tags:** web-testing, katalon-studio\
**Created:** [March 8, 2019, 10:30pm UTC](https://forum.katalon.com/t/list-variable-mapping-to-an-excel-file-cell/20825 "2019-03-08T22:30:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Hampson](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@Michael\_Hampson](https://forum.katalon.com/u/Michael_Hampson)\
**Post date:** [March 8, 2019, 10:30pm UTC](https://forum.katalon.com/t/list-variable-mapping-to-an-excel-file-cell/20825/1 "2019-03-08T22:30:11Z")

</div>

Hello,

I’m trying to pull data from an excel file in the ‘List’ variable type format. However when I try to print an item in the list it doesn’t seem to work.

Example:  
Excel Test File Cell - [“value1”, “value2”]

Above is mapped to List variable ListVar1 via Test Suite Data binding

In my code:  
println(ListVar1[0])

I would expect it to print out ‘value1’, but instead it prints out ‘[’, which seems to indicate to me it thinks the value is a string. Note: I’ve also tried [‘value1’, ‘value2’] and [value1, value2] in the excel cell.

If i setup a list variable in katalon with default value [“value1”, “value2”], then my print statement displays the correct value.

Anyone have any ideas?

Thanks

---

<div class="post-metadata">

**Author:** ![Andrej\_Podhajsky](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/andrej_podhajsky/32/1055_2.png) [@Andrej\_Podhajsky](https://forum.katalon.com/u/Andrej_Podhajsky)\
**Post date:** [March 9, 2019, 6:20am UTC](https://forum.katalon.com/t/list-variable-mapping-to-an-excel-file-cell/20825/2 "2019-03-09T06:20:35Z")

</div>

Hello,  
ok … so …  
you get value as an string. string is basically (can be represented) as an array of chars so by addressing 0 position of string you get 1st char of string “[” in your case  
to achieve what you want:  
store list in format : value1,value2,value3  
use String function split() [https://www.tutorialspoint.com/groovy/groovy\_split.htm](https://www.tutorialspoint.com/groovy/groovy_split.htm)

```auto
class Example {
   static void main(String[] args) {
        String listSource = 'value1,value2,value3'
        String[] list = listSource.split(',')
        println list[0]
   } 
}

```
