Excel reading and writing with []

Hello! I’m facing an odd situation. I have this Excel file. Very simple.

aa5

And I have this project. I’m reading the lines, saving the content within a variable (type Table) and writing the results in a Notepad file.

aa1

I’m doing a loop and then saving the results

aa2

aa3

Finally, the results have these [] symbols…
Take a look:

aa4

Follow the project. Do you know what’s wrong?

1515268062620.zip (108.4 KB)

Thanks a lot,
Trajano

@trajano_leme
Hi Trajano,
When you iterate through a Table variable using For Each you get a list as a result, that is why the value is displayed in brackets.
In order to get a cell value without brackets, you need to iterate additionally through the list as shown below.

Here is a link to a similar topic on the forum https://forum-2-new.workfusion.com/t/foreach-loop-with-index/21030

Alesia

Oi @ashapkina. Thanks a lot. So, should I use a loop inside other loop? In previous versions of RPA, it was not necessary. In the 4th image, the “index” field, should not solve it?

1 Like

@trajano_leme You are right, we’ll try to fix it for future releases. For now, please use two For Each loops as a workaround.

I have a simple case as a test. I start with a spreadsheet with a list of stock ticker symbols. I create a table variable from this data.

I then iterate over the table using the variable ‘ticker’. When I then open a web page and do a ‘Web Element(set by xpath)’ action, the value entered in the web page field includes not only the value but the brackets as well - ‘[TSLA]’ vs ‘TSLA’.

Am I doing something wrong or is this a bug?

Note: I am using Version 1.1.9-beta, WorkFusion RPA Express, Sunbird

@ToddSor
Hi Todd,
Please see the post above for the workaround.
We will fix this issue in the future releases.

Alesia

Ah, now I get it!

This is not a bug, per se. Iterating through a table gives a variable of type list which of course may have many values. Just using the list variable is actually requesting all values of the list.

How will you fix this? It also does not seem quite right to add logic to make a special case out of a single-column table - making the iterator return a single value rather than a list. Or will you make the Excel Get Range action return a list instead of a table in the case values from a single column are requested?

@ToddSor We are not planning to change the logic of the Get range action, just the behaviour when a user points to a specific cell in a table using index.

1 Like

@ToddSor @trajano_leme
We have fixed this issue in RPA Express 1.2.0. Using index with a table in For Each loop action returns a value without square brackets.

1 Like