Does SmartSheet support any CURL to get the total row count in a sheet?
I am using curl with REST to access Smartshets in my C# running on WIN CE. My application is supposed to dump some data on smartsheet periodically.
Before I write to a sheet, I would like to know the total row count in the sheet so that I don't exceed 5000 rows per sheet.
I am looking for an API that would return just row count given the sheet id?
Currently using below API which returns the entire sheet data and takes very long to fetch and format. curl https://api.smartsheet.com/2.0/sheets/{sheetId}
with data of upto 5000 rows per sheet, it takes very long to fetch and format the response having all the row data for each cell.
Comments
-
This question was asked on StackOverflow as well. Here is the answer I provided on that post:
There isn't a request to specifically return the number of rows on a
Sheet
. But, with anyGET /sheets/{sheetId}
operation the resultingSheet
object returned will have a top leveltotalRowCount
attribute on it. So, you don't have toGET
the sheet and count the objects in therows
array. Instead you can look to thetotalRowCount
attribute and the value there to know how many rows are currently on the sheet.If you are concerned about pulling down all of the
Sheet
data you can use paging to keep from getting all of the data returned. Doing aGET /sheets/{sheetId}?pageSize=1
will give you theSheet
object with only the first row of data to help make the payload smaller. ThetotalRowCount
attribute will still be present in the response.
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