Overview
Aggregation Filtering allows you to calculate summary values for records retrieved through a workflow's Lookup Search element.
Instead of storing all matching records or only the first matching record, you can select Aggregated Result and configure aggregation operations on specific fields.
Ordway currently supports five aggregation operations:
- SUM
- MIN
- MAX
- COUNT
- AVG
For example, you can use a Billing Schedule lookup to calculate the total, minimum, maximum, average, and count of List Price values across its associated Billing Schedule Lines.
The aggregated values are available in the workflow execution context and can be reviewed in Workflow Logs.
Contents
- Prerequisites
- Enable Aggregation Filtering
- Configure Aggregation in a Workflow
- Supported Aggregation Operations
- Example: Aggregate Billing Schedule Line Prices
- View Aggregated Results in Workflow Logs
- Use Aggregation When Creating Workflows Through the API
- Troubleshooting
- Frequently Asked Questions
Prerequisites
Before configuring aggregation in a workflow, ensure that:
- Workflow Automation is enabled for your company.
- The Aggregation Filtering setting is enabled in CSP Settings.
- You have access to create or edit workflows.
- You have identified the Ordway object and fields on which you want to perform the aggregation.
Note: Workflow Automation and Aggregation Filtering must both be enabled for the Aggregated Result option to appear in the Lookup Search configuration. Contact Ordway Support or your implementation team if these settings need to be enabled.
Enable Aggregation Filtering
Aggregation Filtering requires the corresponding setting to be enabled in CSP Settings.
Ensure that the following settings are enabled:
- Workflow Automation
- Aggregation Filtering
Once both settings are enabled, the aggregation options become available in the workflow Lookup Search element.
Configure Aggregation in a Workflow
You can configure aggregation operations directly within a workflow's Lookup Search element.
Add a Lookup Search Element
- In Ordway, navigate to Workflows.
- Create a new workflow or open an existing workflow.
- From the Toolbox, select Lookup Search.
- Add the Lookup Search element to the workflow.
- Configure the basic lookup details.
| Field | Description |
| Label Name | Name displayed for the workflow element. |
| API Name | Unique name used to reference the element in the workflow. |
| Select Object | Ordway object from which you want to retrieve records. |
- Configure the required filter criteria to identify the records to retrieve.
- Provide the corresponding record IDs or other applicable filter values.
For example, you can select Billing Schedule as the object and configure a filter using the Billing Schedule ID.
Select Aggregated Result
The Lookup Search element provides three options under How Many Records to Store:
| Option | Description |
| All records | Stores all records returned by the lookup. |
| Only the first record | Stores only the first record returned by the lookup. |
| Aggregated Result | Calculates and stores the configured aggregation results instead of storing the full matching record collection. |
To configure aggregation:
- Locate How Many Records to Store in the Lookup Search configuration.
- Select Aggregated Result.
- The Aggregation and Group By tabs become available in the Lookup Search configuration.
- Select the Aggregation tab to configure the required operations.
Important: Select Aggregated Result before configuring aggregation operations. The Aggregation and Group By tabs are available only when this option is selected.
Configure Aggregation Operations
After selecting Aggregated Result, configure the fields and operations to calculate.
- Open the Aggregation tab.
- In the Field dropdown, select the field on which you want to perform an aggregation.
- In the Operation dropdown, select the required aggregation operation.
- To add another operation, click ADD AGGREGATION.
- Repeat these steps to configure additional field and operation combinations.
- Click DONE to save the aggregation configuration.
- Save the workflow.
You can configure multiple aggregation operations on the same field.
For example, for the Billing Schedule Line List Price field, you can configure:
| Field | Operation |
| List Price | AVG |
| List Price | SUM |
| List Price | MIN |
| List Price | MAX |
| List Price | COUNT |
Supported Aggregation Operations
Ordway supports the following five aggregation operations:
| Operation | Description | Example |
| SUM | Adds all matching values together. | 100 + 100 + 100 = 300 |
| MIN | Returns the smallest matching value. | 100, 150, 200 → 100 |
| MAX | Returns the largest matching value. | 100, 150, 200 → 200 |
| COUNT | Returns the count of matching values. | Three matching values → 3 |
| AVG | Calculates the average of matching values. | (100 + 150 + 200) / 3 = 150 |
You can select different operations for the same field to retrieve multiple summary values from a single lookup.
Example: Aggregate Billing Schedule Line Prices
Consider a workflow that retrieves a Billing Schedule and calculates aggregation values for its Billing Schedule Lines.
In this example:
- Object: Billing Schedule
- Billing Schedule ID: BS-12528
- Field: List Price
- Number of Billing Schedule Lines: 12
- List Price for each line: $100.00
Configure the Lookup Search element to retrieve the Billing Schedule using its ID and select Aggregated Result.
Add the following aggregation operations for the List Price field:
| Field | Operation |
| List Price | AVG |
| List Price | SUM |
| List Price | MIN |
| List Price | MAX |
| List Price | COUNT |
The resulting values are:
| Aggregation | Calculation | Result |
| SUM | 12 × $100.00 | $1,200.00 |
| MIN | Lowest List Price | $100.00 |
| MAX | Highest List Price | $100.00 |
| AVG | $1,200.00 / 12 | $100.00 |
| COUNT | Number of matching values | 12 |
The aggregation returns a total List Price of $1,200.00, while the minimum, maximum, and average List Price are each $100.00.
This example demonstrates how aggregation calculates summary values across multiple Billing Schedule Lines without requiring the workflow to store every matching line individually.
View Aggregated Results in Workflow Logs
After configuring the aggregation, run the workflow to calculate the results.
To review the output:
- Open the configured workflow.
- Click RUN to execute the workflow.
- Navigate to Workflow Logs.
- Open the completed workflow execution.
- Select the Workflow Context tab.
- Locate the relevant Lookup Search element using its configured API Name.
- Review the aggregated values returned in the workflow context.
For example, the Billing Schedule aggregation output contains fields such as:
| Output field | Example value |
| list_price_SUM | 1200.00 |
| list_price_MIN | 100.00 |
| list_price_MAX | 100.00 |
| list_price_AVG | 100.00 |
The field name in the workflow context identifies the source field and the aggregation operation applied to it.
Note: Monetary aggregation results are displayed as currency values, including the appropriate decimal places, rather than as raw cents.
Use Aggregation When Creating Workflows Through the API
Aggregation Filtering is also supported when creating workflows through the API.
When creating a workflow through the API, include the required aggregation configuration in the workflow request.
The configuration must specify:
- The Lookup Search element and the Ordway object to retrieve.
- The filter criteria and record identifiers.
- The fields on which aggregation is required.
- The aggregation operation for each selected field.
For example, to calculate the SUM, MIN, MAX, COUNT, and AVG of a Payment field, include the appropriate object, field, filter, and aggregation configuration in the workflow request.
The API request uses a JSON payload to define the workflow configuration.
Note: The workflow configuration must include all the required lookup and aggregation properties. An incomplete or incorrectly structured request may prevent the workflow from being created or executed successfully.
For most users, configuring aggregation through the workflow UI is the more straightforward approach.
Troubleshooting
| Issue | Possible cause | Resolution |
| Aggregated Result is not available | Workflow Automation or Aggregation Filtering is disabled. | Contact Ordway Support to verify that both settings are enabled. |
| Aggregation tab is not displayed | All records or Only the first record is selected. | Select Aggregated Result under How Many Records to Store. |
| Aggregation results are missing | The workflow has not been executed or the relevant lookup element has not returned results. | Run the workflow and review the Workflow Context in the execution log. |
| Aggregation values are unexpected | The selected object, filter criteria, field, or operation may not match the intended records. | Review the Lookup Search configuration and verify the filter values and aggregation selections. |
| Workflow creation through the API fails | The workflow JSON payload may be incomplete or incorrectly structured. | Verify that the required object, filters, fields, and aggregation operations are included. |
Frequently Asked Questions
| Questions | Answers |
| What is Aggregation Filtering in Workflows? | Aggregation Filtering allows you to calculate summary values for records retrieved through a Lookup Search element without storing the entire matching record collection. |
| Which aggregation operations are supported? | Ordway currently supports SUM, MIN, MAX, COUNT, and AVG. |
| Which Ordway objects support aggregation? | Aggregation can be configured for objects available in the workflow Lookup Search element. The demonstration includes Billing Schedule, Invoice, Order, Payment, Credit, Product, and other lookup objects. |
| Can I perform multiple aggregation operations on the same field? | Yes. You can add multiple aggregation configurations for the same field. For example, you can calculate SUM, MIN, MAX, COUNT, and AVG for a Billing Schedule Line's List Price. |
| Where can I view the aggregation results? | Run the workflow and open its execution log. The aggregated values are available in the Workflow Context tab under the corresponding Lookup Search element. |
| Can I configure aggregation through the API? | Yes. You can create a workflow through the API and include the required lookup and aggregation configuration in the JSON request. |
| Do I need to enable any settings before using aggregation? | Yes. Both Workflow Automation and Aggregation Filtering must be enabled in CSP Settings. |
| Can I use multiple record IDs in the lookup filter? | Yes. The demonstration confirms that multiple record IDs can be used. No numeric maximum was specified in the walkthrough. |
Comments
0 comments
Please sign in to leave a comment.