Using what is inside the excel row as a variable in "for each row" activity


Could anyone please explain what I’m not doing correctly here?

So what I want is:

I want the StudioX to do some action for each row, the row contains Number and I want it to be my variable (lets say it copies the number to a website and do some things there)


I have it set like that:

And I’m getting a validation error: Error ERROR Validation Error Cannot assign from type ‘UiPath.Excel.ExcelValue’ to type ‘System.String’ in Assign activity ‘Set Variable Value’. Main.xaml

Do you have any idea?

Hi @marcin.chowaniec

Please try this in the Assign activity:

contentofeachrow = CurrentRow("Number").ToString

This will give you the data in the string format & contentofeachrow will become 399555 in the first iteration & so on.

If you need the same but in Integer form, then declare contentofeachrow variable as Integer & do this:

contentofeachrow = CInt(CurrentRow("Number").ToString)

Hope this helps,
Best Regards.

Thank you however I really need to do this using the StudioX only :frowning:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.