Multiple query parameters using the API's Search Sheet Method
Hello, I need to find out the ID of a line where the column "Column1" has X value and Column "Column2" has Y value, that is, my query has two parameters. (column:Column1 "X" column:Column2 "Y")
GET https://api.smartsheet.com/2.0/search/sheets/{sheetId}?query=column%3AColumn1%20%22X%22%20column%3AColumn2%20%22Y%22
I found some old posts that taught how to make a call using the Post method with a query of this style in the Body, however in the current API documentation it seems that this method does not exist.
Is there a possibility to use this method GET "Search Sheet"? What would be the query I need to use?
Answers
-
If you can use the Smartsheet Live Data Connector to run a SQL query against the sheet, this is easy.
A workaround for the API would be to create a filter on the sheet that only leaves rows with Column1 = X and Column2 = Y. Apply the filter on the sheet, then run a GET on the sheet, with a query parameter of include=filters. In the sheet information, under userSettings, you'll see "appliedSheetFilterId": - save that filterId.
Then run your GET again, with query parameters:
filterId={the filterId you saved}
exclude=filteredOutRows
You'll then only get the rows returned that fall under your filter.
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!
-
I'm don't believe you can do this with with a query.. You will likely need to loop through an array of rows and check whether both columns match your criteria's. are you using Bridge?
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.3K Get Help
- 423 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 144 Just for fun
- 59 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives