Overview
This recipe shows you how to retrieve cards from a board and filter them by field values on the client side.The Aptly API does not currently support server-side query parameters for filtering. Filtering is done after fetching the full data set. For large boards, consider using webhooks to maintain a local copy of the data that you can query directly.
What you need
- Your API key and board ID from Card Sources > API
- The field name you want to filter on (fetch the schema to confirm exact names)
Step 1: Fetch all cards
Use the pagination pattern to retrieve every card from the board.Step 2: Filter by a single field
Step 3: Filter by multiple fields
Step 4: Filter by a partial string match
Step 5: Group results by a field value
Things to watch out for
- Field names are case-sensitive.
card.stagewill always beundefinedif the field is namedStageon the board. - Cards with no value for a field will have that key missing entirely from the object, not set to
null. Use optional chaining (card.Email?.toLowerCase()) to avoid errors.
Next steps
- Build a custom report using grouped and filtered data
- React to a card update to keep a local copy in sync for faster querying
