Getting Error in For Each

Hi Team

I’m getting an error while reading excel file and iterating through the each row

LogOutput is datatype UiElement, which is no an enumerable datatype (ie datatable, array, list, etc)

HI @sachin_hu

LogOutput → DataTable (Variable Type)

Instead of using For Each activity use For Each row in Data Table activity

Regards
Gokul

Facing this error now

Hi @sachin_hu

What is the variable type of the LogOutput?

Variable type : Data Table

its showing error in Use Application/browser

Hi @sachin_hu

Remove the Output element Variable in the Use application activity

Regards
Gokul

You can’t use a datatable as the Output Element. You’re getting things all mixed up. The Output Element property gives you a UI Element object to reference later. It has nothing to do with outputting any data.

And you don’t use Use Application/Browser to read from Excel. You use the Excel activities (Excel Application Scope, Read Range, etc). Read Range is where you’d populate LogOutput which is a datatable.

This is how you read from an Excel sheet:

And this is where your datatable variable goes, in the properties of the Read Range activity:

image

Then you can For Each Row in Datatable through the data.

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