Can you use the API to call and get just the first row ID?
I have 10,000K line database and I need just the row ID for the first row -- currently I'm grabbing the entire JSON table to then query for the ID, but that takes a bit of time. Is there a re way to just ask for that first row ID?
You can do this for columns like this:
first_column = [] first_column.append(ss.Sheets.get_columns(sheet_id, include_all=True).data[0].id)
But you can't do the same thing for a row, such as this:
first_row = [] first_row.append(ss.Sheets.get_rows(sheet_id, include_all=True).data[0].id)
Any thoughts?
Best Answer
-
In the Get Sheet method, you can pass a rowNumbers query parameter - a comma-separated list of row numbers to include in the result, filtering out the other rows.
Smartsheet API Guide - Get Sheet
Maybe try that and see if it works how you'd expect.
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
Answers
-
In the Get Sheet method, you can pass a rowNumbers query parameter - a comma-separated list of row numbers to include in the result, filtering out the other rows.
Smartsheet API Guide - Get Sheet
Maybe try that and see if it works how you'd expect.
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
-
Thanks! I'll look into that -- I picked through the json schema and figured out that I can also use:
header_row = ss.Sheets.get_sheet(sheet_id).rows[0].id
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives