Search code examples
pythonsmartsheet-api

Iterate through all rows Smartsheet API Python


I am trying to iterate through all the rows in a sheet, but it seems that simply using .rows is limited to returning 100 items.

for temp_row in inventory.rows:
    x += 1
print x #X will always return <= 100

No matter how many items I have in there.

What am I doing wrong?

Edit: Just to clarify, I am trying to do something to every row, not count them, that is just an example of how i noticed it is only grabbing 100 rows.


Solution

  • By default, get_sheet will return a page with 100 rows. Include the flag: includeAll=true to return all rows.

    See the documentation on paging for more info.