How to update multiple rows at once
Does the update_rows() function allow for multiple rows to be referenced? I am working on creating a sheet that needs to have the most up-to-date data which comes from a database. If data in the database changes, I would like to be able to make the necessary updates to all the rows affected. I'm working with large amounts of data so I was wondering if this function would be able to make the updates for me at once.
Answers
-
We tend to maintain a (sorry c#):
List<rows> rowsToUpdate as a set of change values.
So, run round our update loop and change all the required cells on every row that needs to be changed.
And then call UpdateRows:
IList<Row> updatedRow = smartsheet.SheetResources.RowResources.UpdateRows(
sheetId, rowsToUpdate);
-
Hi Bking,
I'm having 1000 rows which needs to be updated and some rows to be added via smartsheet API method in UiPath. It's taking time, Could you please suggest fastest method and I'm having unique ID as well.
Thanks,
Sandhiya P
-
it is crazy that this functionality is not available here.
It is standard in trello and monday.com -
The way you can bulk update rows:
do the same you are doing to build a single row, but initiate a list (python)
rows_to_update = []
each time you have a new row ready to update, append to this list
rows_to_update.append(row)
depending of the number of columns in the sheet you can update every 200 or so rows update the sheet using the list (see below) and initialize it and continue, this bulk action can save a lot of time. if you only have a few columns to update, you can even make it to 500 rows at the time.
then use:
updated_row = smartsheet_client.Sheets.update_rows(<sheet id>, rows_to_update)
rows_to_update = []
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.4K Get Help
- 424 Global Discussions
- 221 Industry Talk
- 465 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 145 Just for fun
- 62 Community Job Board
- 463 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 301 Events
- 39 Webinars
- 7.3K Forum Archives