how can i loop a process which has 2 different values in one of the column in excel for example “NP” and “SP”. example there are 3 rows containing “NP” and 2 rows containing “SP”
i want to be able to submit the necessary information for “NP” first then move on to the rows containing “SP”
' Filter the DataTable for "NP" rows
npDataTable = dataTable.AsEnumerable().Where(Function(row) row("ColumnName").ToString().Trim() = "NP").CopyToDataTable()
' Filter the DataTable for "SP" rows
spDataTable = dataTable.AsEnumerable().Where(Function(row) row("ColumnName").ToString().Trim() = "SP").CopyToDataTable()
' Process "NP" rows
For Each row In npDataTable
' Process the necessary information for "NP"
End For Each
' Process "SP" rows
For Each row In spDataTable
' Process the necessary information for "SP"
End For Each
how can i then use an if activity perhaps such that after it processes “NP” if the next row doesnt contain “NP” and contain “SP” instead then it will proceed on to process for “SP” instead
meaning i want to make it in a way if its not “NP” then it will process “SP”
’ Loop through each row in the DataTable
For Each row In dataTable
’ Use an If activity to check if the column value is “NP”
If row(“ColumnName”).ToString().Trim() = “NP”
’ Process the necessary information for “NP”
Else
’ Use another If activity to check if the column value is “SP”
If row(“ColumnName”).ToString().Trim() = “SP”
’ Process the necessary information for “SP”
End If
End If
End For Each
hi however, i do not have to have another row in excel like the “Status” row, what i need is to read either “NP” or “SP” then to correctly select the correct dropdown list on an website.
i tried using the if condition the CurrentRow.Item(“ColumnName”).ToString = “NP” and under the Then activity of this if condition i used a type into activity to navigate to the corresponding dropdown list. However, it doesnt execute this type into activity. Why is this so? Thanks
may i ask if there is a way like previously i used chunk size to divide into chunk of 4 then the next time it loops, it skips the first 4 rows and runs the next 4 etc.
is there a way to use similar method but instead of using chunk size, i use similar words that are contained in the column.
for example if there are 5 rows with first 3 rows containing “NP” in row 1 to 3 and row 4&5 containing “SP”
so the first loop would run the rows containing “NP” then the next time it loops, it skips the rows containing “NP” and run the next rows containing “SP” etc
thanks
This two loop logic also working the same way. It will process “NP” first and then “SP”. Even if we are able to chunk by the SP/NP your select activity not going to work with that as well.
okay so does the 2 for each row in data table means if it doesnt contain “NP” then is will automatically proceed on to the for each row in datatable which contains “SP” , the second for each row in datatable
hello!! may i ask if there is a way like previously i used chunk size to divide into chunk of 4 then the next time it loops, it skips the first 4 rows and runs the next 4 etc.
is there a way to use similar method but instead of using chunk size, i use similar words that are contained in the column.
for example if there are 5 rows with first 3 rows containing “NP” in row 1 to 3 and row 4&5 containing “SP”
so the first loop would run the rows containing “NP” then the next time it loops, it skips the rows containing “NP” and run the next rows containing “SP” etc
thanks! however when i set the first row in excel to contain “SP” it didn’t proceed on to the second for each row in data table activity instead it still run the first for each row table
it is suppose to move onto the second for each row in data table activity as “SP” is stated instead of “NP” but it is not doing so