Error in for eachrow in Datatable Modern design

Hi Everyone,
I’m facing an issue in for each row in datatable activity. When i try to get current row value it is throwing me an error.

Note : I’m using UiPath modern design and C#

Hi @Learner007

First you can check what row it is getting in For each loop. Just type currentrow in Immediate while running in Debug mod giving breakpoint on any activity inside for each.

If ReadConfig is Datatable, Try using For each row activity instead.

regards
Loveleet Saini

I’m using workbook activity to read my excel sheet.

readconfig variable is DataTable

now i’m using for each row in datatable activity to iterate my row data. when i try to do that it is showing me an error. which i have attached my screenshot in topic.

if i print only Currentrow it will return me as system.data.datarow in messagebox

Match the exact Column Name. Is it Name?

My column name in excel is “Name” only. I gave same. I’m getting this error while writing the condition only. it is not accepting the above code.

Hi @Learner007

Try to Use like this

Row["Column Name"].ToString()

image

Regards
Gokul

1 Like

Clear the Assign & Close the Xaml once & retry.

Hi @Gokul001 It is working. Just have another error in same loop. can you help me. I’m using Modern Design for the first time. All are working differently here.

HI @Learner007

You try like this in the if activity

String.IsNullOrEmpty(Row["Column Name"].ToString())

image

Regards
Gokul

1 Like

Thanks @Gokul001 It is working

1 Like

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