Glad to be here. Very early days for me with using UiPath and I have a situation I wanted to get some help with. Please bare in mind I am a novice when it comes to automation and the options present in Studio.
In short: I have a Google spreadsheet with one column, every row cell contains a URL and I would like the robot to go through each cell, perform a set of activities (clicking on a menu, perform a file download and upload to GDrive) and then move to the next row.
The setup I currently use does work, but the robot only goes through the first row and loops.
The setup currently looks like this:
For Each Row in Spreadsheet
Read Cell
Use Browser
I guess the problem is in the fact that I would have to provide to the Read Cell activity a variable from the For Each Row activity output. Even though there is an option to select a CurrentItem as a variable in the Read Cell activity I can’t figure out what to pick from the sub-options of the CurrentItem.
Any suggestions on how to do a better setup?
Thank you!
Why are you using Read Cell? Getting the value of each cell in the row is inherent in For Each Row in Spreadsheet. Using Read Cell inside For Each Row in Spreadsheet is redundant and unnecessary.
Okay, I can understand the redundancy but it was the only way to have the browser open the URL in the cell.
I am stuck on picking out a variable for the URL field in Use Browser (I would expect the CurrentRow to be the variable to be used, but it displays this message, screenshot below).
Any help with what should I pick from the CurrentRow variable options?
My Google spreadsheet only has one column (A) and no header. How should I format your suggestion? I just want the robot to run through column A, rows 1-150.
Thank you Anil_G, the robot now goes through all the rows in the spreadsheet but I have another problem:
As it saves the file from every opened page locally and uploads it to a Gdrive folder, this only works correctly for the first 2 files in the spreadsheet.
Even though we can see in the stream that it opens the correct page and downloads a different file, each time, the 3rd uploaded file and the ones that follow are actually the 2nd downloaded file, every time.
After downloading the file, the robot goes through the following activities:
Using Path Exists activity with the following expression: Directory.GetFileSystemEntries((Directory.GetDirectoryRoot(Directory.GetCurrentDirectory)+"tmp/home/Downloads"), "*.svg", SearchOption.AllDirectories)(0)
Followed by Upload Files with expression: Enumerable.Repeat(___map_PathExists_3__Resource, 1).ToList()
Really not sure what you’re trying to do here. I think you don’t need the Path Exists activity, it’s not doing anything.
Where did you get that Upload Files activity? I only see a Google Drive activity that uploads one file at a time (ie Upload File). Anyway, you probably just have to provide Directory.GetFiles("folderpath) to that so it can upload the files.
You’re overcomplicating things.
Create folder to store files
loop through spreadsheet
– download file to folder you created (if your browser is just automatically putting them into the C:\Users\username\Downloads folder then just use the wait for download activity and then move the file to the folder you created)
in the Upload Files activity, use Directory.GetFiles to provide an array of files in the folder you created
Thing is, this was all happening in the cloud, robot opening website, robot downloading on server and then uploading on Google Drive in order for me to access files.