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