Update the single file at same time using multiple performer bot

We have BOT performance tracker (Excel) that needs to be update the status of each transaction (success/failed/exception) by BOT at the end of each transaction.

Multiple performer bot is processing the single queue items and those bots will try to update the file at same time.

Since multiple bots are trying to access the file at same time the bot was unable to update the tracker and the process is not moving further

How to update same file by multiple bots without any issues?

Hi @Sathish_Kumar_S

You can check this thread

Thanks & Regards,
Nived N

Sorry, I couldn’t understand what exactly do with below points

There is no such locking mechanism.
You can use some sort of locking mechanism on your own. Like
→ Create a notepad file with a status “Completed”. This file can be accessible by other 2 robots.
→ In a while loop (look for this file and status).
→ Once the file is found, break the while loop and proceed with the next activities.

Consider your robots to be humans… I know… SciFi stuff but still.
What happens if 2 persons work on the same document?

  • either one person can edit, and the others are locked out / get read only errors etc…
  • The document is a shared document; as long as nobody edits the same part at the same time this is possible.

Scenario 1: if only one entity (human or robot) can edit a document, then the next one should wait untill it is his/her/its turn. So what Nived linked above: build a locking mechanism / detection, and have a bot wait for its turn to write. For example: a looped try/catch writing the document. If failed, wait 3 seconds, then try again, otherwise exit the loop.

Scenario 2: make your target documents shared, so multiple entities can write and save at the same time. Often excel is used, and excel can be easily set to allow multiple users to edit.

Scenario 2 of course being the easy way out, if your documents support this.

1 Like

a looped try/catch writing the document. If failed, wait 3 seconds, then try again, otherwise exit the loop ->>>> Can you give me sample xaml file for this activity?

After work, sure… (posting on coffee break ;))

Update:
This is a rough setup:

Mind that this does allow for an infinite loop, so you need to implement some max number of tries in it as well. Else your bot is waiting indefinately if somebody deletes a document or keeps it opnened before the weekend without shuting down.

1 Like

Thank you very much

Create a single automation that updates the Excel file. This automation will pull from a queue. Other automations put items into that queue telling it which file to update and what data to write.

1 Like

Yeah but that would be the smart way to do it… We can’t have that :wink:

Hello @Sathish_Kumar_S

Have you checked the possibility of using an excel in the sharepoint which can be accessed parallelly? I think it can solve the issue.