Actions74
- ai Actions
- array Actions
- audiovideo Actions
- carbone Actions
- charts Actions
- code Actions
- data Actions
- datetime Actions
- events Actions
- files Actions
- geo Actions
- hellospaces Actions
- images Actions
- Get Metadata of an Image
- Scale an Image
- Overlay an Image on another Image
- Scale an Image to Fit Given Dimensions
- Resize an Image
- Mask an Image with Another Image
- Mask an Image with a Circle Mask
- Crops an image by the given x, y, width and height paramters.
- Convert Texts to an Image
- Convert HTML String or URL to an Image
- Generates a QRCode with given text and color.
- Get EXIF from Image
- Remove EXIF from Image
- Modify Image EXIF
- playground Actions
- spreadsheet Actions
- stripe Actions
- youtube Actions
array → Filter an Array by an Operator
AI-generatedOverview
This node provides a "Filter an Array by an Operator" operation for the "array" resource. It allows you to filter an array of objects based on a specified field, operator, and criteria. This is useful in scenarios where you need to extract only those items from a dataset that match certain conditions, such as filtering orders above a certain value, selecting users with a specific status, or extracting records within a date range.
Practical examples:
- Filtering a list of products to include only those with a price greater than $100.
- Selecting users whose email addresses match a specific domain (with optional case sensitivity).
- Extracting log entries where the severity equals "error".
Properties
| Name | Meaning |
|---|---|
| Data | Array of lines with mixed values. The input array to be filtered. |
| Query field | Name of the field in each array item to apply the filter condition. Case sensitive. |
| Operator | Comparison operator to use for filtering. Options: eq (equals), ge (greater or equal), gt (greater than), le (less or equal), lt (less than), ne (not equal). Defaults to eq. |
| Criteria | Value to compare against. Must be a number or string. |
| Ignore case sensitivity | If enabled, the comparison will ignore case differences (for string fields). |
Output
The output is a JSON array containing only those items from the input "Data" array that match the specified filter condition. Each output item retains its original structure.
Example output:
[
{
"field1": "value1",
"field2": 123
},
{
"field1": "value2",
"field2": 456
}
]
- If no items match, the output will be an empty array.
- No binary data is produced by this operation.
Dependencies
- External Service: Requires access to the 1001fx API.
- API Key: You must configure the
1001fxApicredential in n8n. - Environment: Ensure your n8n instance can reach https://api.1001fx.com/.
Troubleshooting
Common Issues:
- Invalid API Key: If the API key is missing or incorrect, authentication errors will occur. Make sure the
1001fxApicredential is set up correctly. - Incorrect Field Name: If the "Query field" does not exist in the data, no items will match, resulting in an empty output.
- Type Mismatch: If "Criteria" is a string but the field is numeric (or vice versa), the filter may not work as expected.
- Case Sensitivity: If "Ignore case sensitivity" is not enabled, string comparisons are case-sensitive, which may lead to unexpected results.
- Invalid API Key: If the API key is missing or incorrect, authentication errors will occur. Make sure the
Error Messages:
- Errors from the API are returned in the output under an
errorproperty. For example:
To resolve, check that all properties are set correctly and the operator is valid.{ "error": "Invalid operator" }
- Errors from the API are returned in the output under an