How to loop through if a certain condition ment

Hi,

I have an excel file where “column A” has Names, “column B” has survey and “column C” has address data.

I want to loop through Names in this excel file If Column B and Column C both has “Yes” only.

This is the screenshot of an excel file.

Regards,

1 Like

Hi @raju_alakuntla

=> Use the Use excel file activity and give the path of the excel file.
=> Inside use excel file activity insert the For each excel row activity to iterate the excel rows.
=> Inside for each insert the If condition and write the below condition

- Condition -> Currentrow("survery").equals("Yes") and Currentrow("address").equals("Yes")

=> In then block give the break activity to break the loop. When the condition meets it will break the loop.

Check the below workflow for better understanding.

Hope it helps!!


Refer the above Screenshot

@raju_alakuntla

hi

use for each row in datatable

inside use if activity

condition as

Currentrow("survey’).tostring.equals(“yes”) and Currentrow("address’).tostring.equals(“yes”)

then

place what ever activities you want to execute

cheers

I am getting a message from the website and I am extracting the message after the condition met.
Now I want to write the message against that name in the column D.

How can I achieve this.

Regards,

@raju_alakuntla

yes you can write

if condition matches then

assign currentrow(“ColumnD”)=“Value”

cheers

can you explain me more please.

Regards,

@raju_alakuntla

can you tell which column value you need to compare with the value coming from the website

regards

Its able to meet the condition. and also looping the names only which met the condition. now I have used these names in a website and we are getting a pop up message which needs to be captured for the validation purpose.

Now I want to write the captured message against the name which was provided for that instance.

I have used add data row activity and write range but its writing continuously. But I need to write the captured message against one which name we have loaded. I want to skip the rows which do not meet our condition for writing the message.

I have highlighted the rows where I need to write the message.

image

Regards,

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