Filter
Array Operations – Filter
Summary (SEO Meta Description):
The Array Operations Filter action in WeHub reduces arrays by keeping only elements that match a rule.
Configure path, value, and rule to filter arrays with precision.
Overview
The Filter action allows you to reduce an array by applying comparison rules to its elements.
It is useful for workflows where only specific records or items should continue through the pipeline.
⚙️ Configuration Options
| Field | Type | Description | 
|---|---|---|
| Label | String | Custom name for the node (e.g., "Filter Active Patients"). | 
| Path | String | Path to the array field within the object to evaluate. | 
| Value | Any | Reference value used for comparison. | 
| Rule | Enum | Filtering rule. Options: RULE_EQUAL,RULE_NOT_EQUAL,RULE_CONTAINS,RULE_CONTAINS_I,RULE_GREATER,RULE_LESS. | 
| Schema | Schema | (Optional) Schema to validate the resulting filtered array. | 
💡 Example Use Cases
- Keep only patients where status = active.
- Filter out transactions below a threshold (amount > 100).
- Case-insensitive filtering (RULE_CONTAINS_I) on names or codes.
FAQ
Q: Can I apply multiple filters?
A: Yes, add multiple filter rows with different rules.
Q: What does RULE_CONTAINS_I mean?
A: It performs a case-insensitive substring match.
Q: Can I filter nested arrays?
A: Yes, specify the correct path (e.g., patients[*].appointments).
Keywords: WeHub Array Operations, Filter Array, RULE_EQUAL, RULE_CONTAINS, array filtering