API search/get multiple rows in a sheet
I need some help formulating an API call to retrieve multiple rows of data in a sheet that have a specific key word.
I can successfully use the /2.0/search/sheets/xxxxxx?query="A2" query to get a list of rows however I don't know how to continue this query to then pull all the rows of data that match the query.
Answers
-
Does your source sheet have a filter on it that matches the value you're looking for? If so, you could use a Get Sheet request and apply this filter as a parameter:
GET /sheets/{id}?filterId={filterId}&exclude=filteredOutRows
Here's the documentation on this: Get Sheet
Cheers,
Genevieve
-
Can anyone actually confirm that the above ?filterid={filterId} works?
we cannot get this work. the filter id never changes in the response.
we have noticed that if you change filters in the smartsheet website, then the filter ID changes in the response.
-
....?filterid={ID}&exclude=filteredOutRows didn't help me either could you find a way?
-
I have been trying to figure this out with the python API and discovered in addition to the exclude="filteredOutRows" parameter the sequence of your options are key.
The API code wants the filter_id last. So using something like this works.
t = smartAPI.Sheets.get_sheet(
9905399599899399, # sheetId
exclude="filteredOutRows",
filter_id=5758236805621636, # filterId - created in the Smartsheet sheet
)
I tested it in Postman and this same format works.
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.4K Get Help
- 394 Global Discussions
- 213 Industry Talk
- 449 Announcements
- 4.6K Ideas & Feature Requests
- 141 Brandfolder
- 132 Just for fun
- 131 Community Job Board
- 453 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 293 Events
- 35 Webinars
- 7.3K Forum Archives