Why does the API require the row id to add a row?
Hi.
I want to add a row with the API. I therefore use the Add row method.
This method requires to use the row object.
The first attribute of the object is the row's id. What sense does it make to request the row id to add a row?
If I attempt to add a row without a row id, I get the following error message:
...
"errorCode": 1012,
"message": "Required object attribute(s) are missing from your request: row.id."
...
How are we meant to obtain the row id of a row that does not exist yet? I am confused. This method seems to update existing rows, rather than add new rows. Can anyone please clarify how this method is meant to be used?
Answers
-
-
You don't provide the Row ID. If you look at the Add Rows documentation section for Request Body schema you will see which parts of the Row Object are required or optional. The Row ID is not included
Now if you want to specify where the Row is added, you can tell it to be Row ID of a sibling or child. (Or simply to be placed above or below all of the existing rows.)
-
Thanks so much for your comment. In effect, the documentation of the Add row method does not mention that the row id is required in the request body schema, that is why I was puzzled when I received an error requiring me to provide a row id. However, thanks to your comment I finally was able to figure out what the issue was, so in case anyone else runs into the same problem, please check that you are doing a
POST
and not aPUT
, otherwise you will be updating a row instead of adding a new one.
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.1K Get Help
- 414 Global Discussions
- 221 Industry Talk
- 461 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