How can I find the row ID of next open row in VBA?
I have VBA code that loops through rows and can give me the row number and row ID of populated rows. It doesn't help me get the next available ID so I can do a put request and add data to an empty row. Currently the VBA just pulls the last populated ID and overwrites it each time. Is there a way to get this??
Answers
-
The rows that have not been used yet do not have a row ID to pull.
-
Is there a statement or something I need to add to my PUT command that tells it to write to next available row?
-
Here is the API documentation on adding new rows to a sheet:
https://smartsheet.redoc.ly/tag/rows#operation/rows-addToSheet
EDIT: For some reason it is really struggling to provide a hyperlink, so here is a text string of the url I was trying to provide…
https://smartsheet.redoc.ly/tag/rows#operation/rows-addToSheet
-
Thank you, I tried using the toBottom like the documentation states:
inputData = "[{" & """toBottom"": true," & """cells"":[{""columnId"":""" & cDDR & """, ""value"":""test ddr 2""}]}]"
but I kept getting an error message that it was unable to add because an attribute was missing. I just assumed the attribute was the rowID because I can't get that to work, and if I replace that with an ID it works fine.
-
Just loop through the sheet twice. The first time build a table with row number and ID. Then when you walk through the sheet you can look up the ID for the next row.
/marc
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives