When you use For each row, you ideally would not need to increment index value. The for each row automatically increments and stops when the last row is handled.
However, if you still need to use a index variable, I suggest you use the default index property. Hit Ctrl+K and create new variable in that property with your required name choice. Then you can use the variable wherever you need it within the For each row activity.
Hey @jeevith Ok, so I don’t need to include an Assign activity at the bottom. But rowIndex is already my variable. Why do I need to create yet another variable again please? Re: Screenshot above
The point is you don’t have to do it. An index variable already is available within a For each/For each row activities. You do not need to increment to it, it automatically does it for you. Your code can be shorter and easier to ready when you use this.
What is the rowIndex variable doing in your workflow? I don’t think you need it at all.
Just create a new variable in the properties section of the For each / For each row activity.
Have you also checked that the Extract Data from Table has successfully finished and all rows are extracted? May be it has extracted same values for all rows?
CurrentRow.Item(1) will return the second column value for the given row. Is that what your If statement is using?
Get the number of rows in your extracted data table and then put the process inside a Do While loop. Do an assign in the Do While loop which reduces the number of rows and set your condition
Assign: dtRowsCount | dt.rows.count
in the Do While do an assign that says dtRowsCount | dtRowsCount - 1
Hi @jeevith@Yogesh1 , yes. The first Row is the title of the table, I only need items from Row 2 onwards.
I’ve since removed the Assign Activities from the script but now it cannot identify what row index to begin executing the script. I added an If condition before the For Each activity. Only if the condition is met, the script will run. Otherwise, to proceed to the next row in search of the key word ‘Process’
Now, it doesn’t even check the IF statement and runs from Row 1 by default
The reason why rowIndex is there, is because i do not need to iterate through every single row. Only selected rows with the key word ‘Process’ located in Column 1.