Hello everyone I’m new to this forum and I’m trying to have my bot do a specific thing and I can’t figure out how to do it. Basically I want my bot to read a cell in an excel file and if that sell has a 1 than to continue running the bot at “1.3.38” activity and if it has a 0 to continue running the bot at “1.3.40.55” activity I’ve tried using an IF statement and I can get the condition to read the excel cell and if the value is equal to 1 to do a specific thing but I can’t get it to continue on a specific activity. If you need me to further explain this let me know. Thanks!
Welcome to the community
So what you need to do is …inside the if condition on then side you need to have all the activities from 1.3.38 till 1.3.40.55 …
So that those are executed only when the condition is satisifed
And the if condition is to be added appropriately where 1.3.38 needs to start
Hope this helps
Cheers
For this you want to use a Flowchart.
Read Cell
Flow Decision to look at the value you got by reading the cell
True goes to your 1.3.38 sequence, false goes to your 1.3.40.55 sequence
Use the read cell workbook activity to read the specific cell in the excel it was stored in a string datatype variable (Ex: CellDataVar) .
Use Else if condition to check the CellDataVar contains 1 or 0.
Condition in else if condition
CellDataVar.equals("1")
In then block give the activities to move forward if values is 1.
Condition in else if condition
CellDataVar.equals("0")
In then block give the activities to move forward if value is 0.
Hope it helps!!
Good morning Mahesh thank you for your reply! Out of all the responses I took to trying yours first.
When you say “then block give the activities to move forward if values is 1” how would I do this?
I want that if it equals one it continues to the “Main” activity you see below in the image. Also you can see me attempting to do what you said I’m not sure if I follow the directions correctly.
Okay @Hansel_Acosta
Then drag and drop the Main sequence in to the Then block which equals 1 condition in Else if condition.
Hope you understand!!
Mahesh I just noticed that this may not work for me. I need it to read every single one of these cells and only perform the code if the cell has a “1” in it. Don’t I need a loop of some kind ?
In that case read the Excel by using read range workbook activity and store it in a datatable.
Use for each row in datatable to iterate the datatable. Inside the for each use If condition to check the Toggle column is equal to 0.
Currentrow(“Toggle”),equals(“1”) It checks everyrow of Toggle column if it has it will go to then block.
In then block drag and drop the main sequence.
Hope you understand!!
Hmm I don’t really get what you mean do you think you can show me an example? I’d greatly appreciate it!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.