Action References
FetchStatsAction
FetchStatsAction
Purpose Computes quick aggregates (count, sum, min, max) across a Data Object and stores the result. Ideal for showing contextual stats or enforcing thresholds.
When to use it
afterCheckInstance(update)afterMainGetOperationorafterMainListOperation
Key fields
| Field | Type | Description |
|---|---|---|
targetObject | DataObjectName | Object from which to aggregate stats. |
matchValue | MScript | Match key value (e.g., this.projectId). |
localKey | PropRefer | Field to match (default id). |
stats | [String] | Aggregations (count, sum(amount), etc.). |
whereClause | MScript | Optional advanced query. |
bucketBy | PropRefer | Optional grouping key for bucketed results. |
contextPropertyName | String | Where results are stored. |
Example
{
"id": "a30-fetch-task-stats",
"name": "fetchTaskStats",
"targetObject": "task",
"matchValue": "this.projectId",
"localKey": "projectId",
"stats": ["count", "sum(hours)"],
"contextPropertyName": "taskStats"
}
Was this page helpful?
Built with Documentation.AI
Last updated Jan 3, 2026