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
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 495 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives