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
spreadsheet → Sumif Spreadsheet Function for an Array
AI-generatedOverview
This node provides a "Sumif Spreadsheet Function for an Array" operation under the "spreadsheet" resource. It allows you to sum values in an array of objects based on specified criteria, similar to the SUMIF function in spreadsheet applications like Excel or Google Sheets. This is useful when you need to aggregate data conditionally within your n8n workflows.
Common scenarios:
- Summing sales amounts for a specific product from a list of transactions.
- Calculating total scores for users meeting certain criteria.
- Aggregating numeric fields where only some records match a filter.
Example:
Given an array of objects representing orders, you can sum the "amount" field for all orders where the "status" is "completed".
Properties
| Name | Meaning |
|---|---|
| Data | Array of objects with at least two properties (e.g., [{"name": ..., "score": ...}]). This is the dataset to process. |
| Query field | Name of the field in each object to compare against the criteria. Case sensitive. |
| Comparison Operator | Operator used for comparison. Options: eq (equals), ge (greater or equal), gt (greater than), le (less or equal), lt (less than), ne (not equal). Defaults to eq. |
| Criteria | The value to compare against. Must be a number or string. |
| Sum field | Name of the field in each object whose values will be summed if they meet the criteria. Case sensitive. |
| Ignore case sensitivity | Boolean flag to set case sensitivity for the criteria operation. Defaults to true (case-insensitive). |
Output
The output will be a JSON object containing the result of the sum operation. The structure typically looks like:
{
"sum": <number>
}
Where <number> is the sum of the specified field for all objects matching the criteria.
Dependencies
- External Service: Requires access to the 1001fx API.
- API Key: You must configure the
1001fxApicredential in n8n. - n8n Configuration: No additional environment variables are required beyond the credential setup.
Troubleshooting
Common issues:
- Case Sensitivity: If results are unexpected, check the "Ignore case sensitivity" property and ensure your field names and criteria match the case as needed.
- Field Names: Ensure that "Query field" and "Sum field" exactly match the keys in your data objects (case sensitive).
- Data Format: The "Data" property must be a valid array of objects; malformed input will cause errors.
- Missing Credentials: If the
1001fxApicredential is not configured, the node will fail to execute.
Error messages:
"error": "Cannot read property '...' of undefined"– Likely due to incorrect field names or missing fields in your data."error": "Invalid API key"– Check your 1001fx API credentials in n8n."error": "Request failed with status code 4xx/5xx"– Indicates an issue with the external API, such as invalid parameters or service downtime.