Skip to content

Get Filters From Search โ€‹

The Get Filters From Search node is used to dynamically retrieve available search filters based on a search term and current filter context. It interacts with the Mesh API to return a list of relevant filters, helping users refine their queries or datasets programmatically.


๐Ÿง  Purpose โ€‹

This task is commonly used in workflows where you need to query or refine data based on user input or pre-applied filters. It helps build dynamic user-driven interfaces where filter options must reflect the search context.


โš™๏ธ Node Type โ€‹

  • Type: task
  • TaskType: GetFiltersFromSearch
  • Category: Mesh / Search Utilities

๐Ÿ“ฅ Input Fields โ€‹

LabelTypeRequiredDescription
Search Texttextโœ… YesThe search string to use as the basis for retrieving filter options.
Current Filtersjson (Text)โœ… YesA JSON object describing currently applied filters (e.g. { "filters": {}, "inputText": "", "optionsLimit": 20 }). It defines the context used when retrieving filter options.

๐Ÿ“ค Output โ€‹

  • The node returns a list of available filters that match the search text and are compatible with the current filter context.

  • The result is stored in a new variable:

    • AvailableSearchFilters: A collection of ChatSearchFilter objects available for the search context.

โœ… Example Scenario โ€‹

If a user searches for "invoice" in a workflow that filters documents, this node returns all relevant filters (e.g., "Document Type", "Date Range", "Client Name") that can further narrow the search results.


๐Ÿ› ๏ธ Backend Behavior โ€‹

  • Validates Search Text and Current Filters fields.
  • Deserializes Current Filters into a FilterRequestCriteria object.
  • Calls the Mesh API via ExecuteGetFilters.
  • On success, populates AvailableSearchFilters and marks the task as completed.
  • On failure, returns with status Fail and a relevant message.

โš ๏ธ Notes โ€‹

  • The Current Filters input must be a valid JSON structure matching the FilterRequestCriteria schema.
  • The optionsLimit is hardcoded to 20 in the current implementation.
  • This node does not perform a search itself โ€” it only retrieves filter options based on search context.

๐Ÿงช Example JSON for Current Filters โ€‹

json
{
  "filters": {
    "Category": ["Finance"]
  },
  "inputText": "invoice",
  "optionsLimit": 20
}

๐Ÿ”„ Output Variable Usage โ€‹

You can use the AvailableSearchFilters output in a subsequent node to present or apply additional filter criteria dynamically.


Tentech 2024