Loop Data Appending to Google Sheets

Hello friendly people :wave:
I am working in Studio Web on automating the following process in UiPath:

  1. For each email received in Gmail with an attachment, I want to Download the attachment and upload it to a specific Google Drive folder.

  2. Once the file is uploaded, I need to Open the file (which will be a Google Sheets file with a sheet named “Sheet1”) and Extract the value from cell I11

  3. Append the extracted value into an existing sheet in cells A2

This process should loop, so for each new file, the values from I11 are added to the next available row in the **existing** file (A3, A4, etc.).

I cannot make this into a loop as every time the new email overwrites the old information.
Has anyone worked on something similar, and if so, what is the best way to structure this automation in UiPath Web?

Any pointers or best practices would be highly appreciated!

@Ivo_Peshev

Instead of write cell use append range activity …which will append the data at the end

Cheers

Hey @Anil_G , thank you for the help!
I would like to do this action with several cells and some of them are strings, others- numbers. However strings cannot be converted into a data table.
Do you have other possible solution?

Thanks

@Ivo_Peshev

Ideally what you would do is say you want to append data to 10 different columns then create a row and add add that row to datatable and use append range directly for once

It can be string number anything

Cheers

Can you please help me editing the command flow for 2 variables?
What function do I need to add, where does it need to be added?

Thank you a lot in advance!

@Ivo_Peshev

First use a build datatable and add all column names you need After read use add data row and add array of elements with variable eg: {"",var1,var2,"","Some value if you need"}

Now at last use append range and pass the datatable which has all data in required columns with one row

Cheers

2 Likes

Hi @Anil_G , at my first trial this approach seem to work!

Thank you very much!

Have a great day and I hope this question will help others as well.

1 Like

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