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
- 64.1K Get Help
- 414 Global Discussions
- 221 Industry Talk
- 460 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives