How to check the condition if particular column in excel is start with particular number then how to update the value in next column accordingly.
Suppose we have some data given as below:
And I want to add the condition here like if enrollment number is start with ‘1’ the need to update the status column as CONFIRM and if enrollment number is start with 2,then need to update the status column as NOT YET PROCESS and so on…
use read range to read the excel
use for each datarow to loop through the row
use if row(0).toString.StartsWith(“1”) then assign row(“Status”)=“CONFIRM”
else if row(0).toString.StartsWith(“2”) then assign row(“Status”)=“NOT YET PROCESS”
Hello @Riya1 Here like this total how many conditions are there?
If conditions are many, suggesting to use switch case activity activity.
1)use for each row in datatable
2)you can get the first value of the number using row(0).ToString.substring(0,1)
3)pass this switch. So case you have to create as 1, 2, 3 etc.
And you can use the write range to update the value after the case.
All these 4 condition are based on startwith number or differnt conditions. instead of assigning the value in row(1) in the code i had shared you cn use row(3)
you can change the code accordingly based on the column position or column name
for eg id column name is Status
you can use CurrentRow(“Status”) or if it is at 4 th position you can use CurrentRow(3) ie. position-1