Smartsheet Get Filtered Sheet
Get the data of a sheet and return only the rows that match a given criteria.
Example: Return every row in a sheet where the Status column is set to Complete.
A GET Sheet request will return all of the current data of the sheet by default. Sometimes only certain rows are needed for a process instead.
This module solves this by:
- Getting the current sheet data.
- Searching through the rows to find matches with the given value.
- Returning only the row objects that match the given criteria in an array.
npm install smartsheet-get-filtered-sheet
//Assumes smartsheetClient has been instantiated elsewhere alreadyconst getFilteredSheet = ;const options =sheetId: 4583173393803140columnId: 2331373580117892filterValue: 'Complete';;
The function takes two arguments, your Smartsheet client object and an options object.
The id of the sheet you are filtering
The id of the column to look for that will have the value to decide if the row is returned or not.
The value to search for in the sheet. A match determines that a row should be returned.