Exception Handling during Each Loop

Hi, I am designing to loop copy excel data to ERP system.
In case the ERP system icon is deactivated, I would like to return error log with specific corresponding ids.

  1. I have designed as attached screenshot but I can’t see any log in text file set up by me

  2. my intention was to make the bot skip exception record and go to next record with loop but it’s not working well

  3. For exception log, I would like to log “ID”. my IDs are in excel file. which variable should I use ? “row” or “element”?

Would you advise?

@JIwoong the bot will skip the actions in Exception Handling only if it encounters an error. Wait for image action doesn’t have an error if the bot cannot find an image, it sets the value of the boolean variable you use in this action to false.
So, if you want the bot to perform different actions depending on whether the image has been found or not, you need to use If-Else condition: if the boolean variable equals true, then perform some actions, else - other actions.

It looks like “element” in your script is in fact a row in the table, and “row” is a cell.
See this tutorial for more info on table variables.

Hi thanks for your reply.
If i have to add “if-else”, do i have to put it under For each loop or under wait for image ?
what i want to do is …

  1. If image is found , then continue to process and after success, write down success ID # in speerate excel file
  2. if image is not found , then skip the record and write down unsuccessful ID # in seperate excel file

You need to put it right after the Wait for image action.

Hi Ashapkina,

I have edited my recorders as attached screen shot

  1. For “Write to File”, i intended to generate both invalid bk (error) and valid (no error) but I can’t use linebreak so i have used workaround . my codes looks messy but if you have better idea please let me know

  2. In addition, if i encounter unexpected pop up message, how can I skip and move to the next record ?