For Each and If activity

  1. I am reading records from excel and paste them into the search box of one web page then hit enter and perform the click activity on the basic of records found. (this is working for me).
  2. But if read record not found on webpage after search operation (No Records found) then how it will move to read the next record.
    It would be great if someone help me on this.

Hi @avinash.wankhede

Use the check app state activity to check if the record not found, indicate on record not found element. If it appears then give the activity to read the next item, on element appears block.
Check the below image for more understanding.
image

If you are using the classic activities then use the element exist activity, the output is boolean use the if condition to check the bool flag is true or false then move forward to read the next item.

Hope it helps!!

Hi @avinash.wankhede
Use check app state activity

@avinash.wankhede

  1. You can use Two activities “check up state”/“Element Exist”
    2 second option is use Get text activity to get (No Records found)
    then put if condition and check text is (No Records found) or not

Hi @avinash.wankhede
Use CheckApp State in modern activities or
Use Element Exists in classic Activities

Hope it helps!!

I am using the check activity inside for each then which activity i can use to read next record

In check app state there are two block one is Target appears and Target does not appear.
Indicate the record not found element. Leave the Target appears block, develop the code to enter the data in the application.
No need to give in target appears it will go to next record. @avinash.wankhede

Hope it helps!!

@avinash.wankhede

Use if condition to check the record if empty or not.
If not empty proceed with the process else continue with next record.

You can use like this:
if(not(String.IsNullOrEmpty(CurrentRow("colName")) or String.IsNullOrWhiteSpace(CurrentRow("colName"))))

Hope it helps.

Thanks for helping me on this.

I have used check activity.
If target appears(record found)-- Click Start
If target not appears (No Records found) — In this block I used Continue, is this OK ,

image

No need to give any continue activities just leave the target does not appear block. @avinash.wankhede
It will continue with the next item.

Happy Automation!!

OK Thanks for Your help.
But using continue in the target does not appear section flow worked for me, atleast this time :slight_smile:

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