How to run a robot and update the result in a separate row in an excel sheet?

Currently I use an excel sheet with login credentials to sign in to a site and download two PDFs, move the downloaded PDFs to a client specific folder and send them to clients’ email , but I am stuck with

  1. Updating the progress as success or failure in a separate column in the same excel sheet.

  2. Some clients’ password may have expired and in that case robot stops there and does not proceed with the next client. Is there anyway for the robot to continue with the next client, if one client’s account couldnt be logged in or couldnt download the files?

1 Like

Hey @Vijay_Manimaran

Just update the data table which you have read and write it back to the same sheet.


1 Like


You can use Write Cell activity or update status directly into DataTable and at the end of all rows you can write the data back into Excel file.

You should enclose that flow inside Try Catch block to handle password expired or any other error. So that it Bot will go the next client if any error occurred also.

I suggest you to use ReFramework template for this process if you are not using it.

Hi @Vijay_Manimaran ,

Use an Element Exists on an element on the Webpage after you login(Something unique which is only present once you login) and if that evaluates to False(use If Activity) then update the Status column in the Excel tracker as “Failure”.

This will take care of both scenarios.

Kind Regards,
Ashwin A.K


Hope the below steps would help you resolve this

  1. Use a excel application scope and pass filepath as input and inside her scope use read range activity and get the output as datatable named dt

Now use a add data column activity and mention the ColumnName as Login Status and datatable as dt which we can use to denote whether it logged in successfully or not

Use one more add data column act and mention ColumnName as Overall Status and datatable as dt
This we can use to update overall status whether file was downloaded successfully and moved to a folder

  1. Then use a FOR EACH ROW activity and pass dt as input

  2. Inside the loop use a OPEN BROWSER activity and pass CurrentRow(“URL ColumnName”).ToString as input which will let open the url to open in browser

  3. Then followed by that use a TYPE INTO activity and pass the column name which holds the username and password may be like this


And another type into activity with input as


  1. Now inside the same LOOP use a ELEMENT EXISTS activity

with that choose any element that would come for sure once the page has logged in and get the output as bool_exists

  1. Use a IF activity and mention the condition as
    bool_exists = True

If true it goes to then block where use a assign activity like this

dt.Rows(dt.Rows.IndexOf(CurrentRow))(“Login_Status”) = “Success”

or if it’s false it goes to ELSE block where mention with assign activity as

dt.Rows(dt.Rows.IndexOf(CurrentRow))(“Login_Status”) = “Failed”

  1. If it’s true then inside the same THEN block keep all the other activities to download and moving the file to specific folder and leave the else block with that one specific assign activity alone

  2. This will go in loop now as all the activities so far are inside the loop

  3. Next to for each row loop now use a write range activity and mention dt as input and enable add headers

This will write on top of the existing table in excel with Login status as well

Hope this would help you resolve this

Cheers @Vijay_Manimaran

Thanks for the help. I will try this and let you know of the result.

1 Like

@Vijay_Manimaran If the passwords are not correct then it must be showing an error. If this is the case then follow below steps

  • Take flowchart, Enter Username
  • Enter pwd
  • Check if that error exists using flow decision
  • If that present then update the value to excel or datatable. If you are updating to data table at the end of the process you have to write to excel at once.
  • Close All applications
  • Continue the process by looping back to the sequence where username and pwd were entering

Please find sample workflow here (3.9 KB)

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