Can't stop the loop after it has read the last data

@amaresan it didn;t worked

Hi,
It seems it fails on this assign
selectno = selectdata.Substring(0,12)

Pls make sure the “selectdata” contains valid data

Cheers

@diptojyotidutta

are you able to open the xaml ? if then what error you are facing

selectdata = row(0).tostring
this is the data which i am assigning to selectdata in the for each loop.

@amaresan the value you assigned to the selectno variable in the assign activity inside the for each loop in your flow is giving the error.

It is likely the expression “row(0).tostring” gives an empty string or string with less than 12 chars therefore the following “selectdata.Substring(0,12)” gives out of range error.

You could put WriteLine activity below “selectdata = row(0).tostring” to show value in selectdata variable.

Cheers

Hi @J0ska,
what should be the expression in the write line activity?

What do you think? :slight_smile:

Sorry but i don’t know:sweat_smile:

image

thanks @J0ska i will use it

Now you should see in the Output pane the last value of “selectdata” before the runtime error.

it’s still giving the same error

Sure. What is the last value in Output pane?

@diptojyotidutta OK fine do one thing count the how many rows are there as datatable. Rows. Count, and cross check how many are going for loop

Thanks…!!