Multiple robots updating the same shared excel file

Hello,

I have a shared excel file in onedrive that is being read and written by multiple robots. However, I came across this problem where the OneDrive could not update or merge the update of the same file. At this point, UiRobot has treated this transaction as successful thus it will move on to the next transaction, causing this data to be lost in the shared excel file.

Subsequent updating of the excel file will cause an error both in the robot as well as the OneDrive. Robot’s error will be unable to read range because in the excel application itself, there is a file recovery prompt. OneDrive’s error would be that it is unable to merge the changes and would require user intervention to choose which data to keep or merge.

Any help is appreciated on how I can prevent such error or to at least detect that the file has finished syncing? The thing is if multiple robots were to update the file at the same time, the frequency of the status “Syncing” will be higher.

Hope that we can find a solution for this. Thank you!

1 Like

Hi @MichaelL

One idea here would be to keep an asset in Orchestrator and set it with something like “true/false” or “busy/free”.

Before the write action of the robot, it could read the asset, and if the file is busy, then wait a bit and retry, and if it’s free, set the asset to busy, do the operation an then set the asset to free again.

I’m not sure how well this will work with many robots running at the same time, but it should already be more robust.

2 Likes

An old school approach - not sure if it could be used with OneDrive.

Cheers

Hello Joska,

This is a great idea. I have to try it because if we are talking about a pseudo file indicating that the file is working, it means there’s uploading of file into the one drive as well. Thanks!

Oh wow this is also a good idea! So you are saying that the common file should be uploaded as an asset?

My suggestion was more about using the asset to ‘guard’ the file, it could be any String Asset with any words you choose. A simple bool will do as well:
image

And then, you could use it to ‘lock’ the file by letting your robots set it to True when they access the file. When they are done with the write operation, they set it back to False.

Naturally, you will need to add an extra loop do periodically check for the Asset until it is False again if one robot is already working on the file.

4 Likes

You could place the semaphore file into any shared location.

But if you use Orchestrator then solution proposed by @loginerror would be better I think.

Cheers

1 Like

I will try this solution out.

I’ll update this topic! Thanks mate!

1 Like

@MichaelL - Do you have any URL which explains how to Read a column A in OneDrive Excel and Update Column B based on conditions? BTW I will be filtering the OneDrive XL Sheet and give a Range in UiPath before read and update.
Please advise.

Hi @a_anandraj_2000 Are you able to access the file via OneDrive?

Hi @loginerror,

i am also stuck in the same issue and your solution might help me as well.
But i am facing challenge in the implementation. Can you please provide any test xaml that can explain how to implement this?