How to read a row from DataRow[]?

Hi, I have been going through the RPA Developer course - Lesson 3 - Data manipulation.
The official answer calls for the use of for each on filteredData (DataRow) and to access cells in writeline: row(“Name”).ToString + " " + row(“Age”).ToString + " " + row(“Income”).ToString.

This approach gives the error: “Option Strict On disallows late bindings” despite the fact that it works in the supplied solution.
However this works in my UiPath Studio:
filteredData(i)(“Name”).ToString + " " + filteredData(i)(“Age”).ToString + " " + filteredData(i)(“Income”).ToString, where I had to declare an index for the for each loop and have not used a row.
It seems to be ineffective to use the for each loop just to generate and pick up a row index.
Where could be the problem?

Hi @fintechilla

Check this

ashwin S

The official was getting the data-row in ‘row’ variable. Can you please check what’s written after ‘For Each’ in your loop? and then you can replace the row with your variable to get the values by using column name.

Hi, thank you. In the meantime I found the difference and missing declaration - I did not specify the ArgumentType in the for each loop - it should be System.Data.DataRow. Is this the argument which is passed as “row” to the Body workflow? Is the body part of an for each loop technically another workflow?
My for each loop looks the following:
“for each row in filteredData (DataRow) Body writeline row(“Name”).ToString”

1 Like

Is it working now?

Yes, it is

It is working now.
Thank you

I had forgotten the TypeArgument value too. Thanks for your input! :slight_smile: