Action ReferencesFetchStatsAction
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)
  • afterMainGetOperation or afterMainListOperation

Key fields

FieldTypeDescription
targetObjectDataObjectNameObject from which to aggregate stats.
matchValueMScriptMatch key value (e.g., this.projectId).
localKeyPropReferField to match (default id).
stats[String]Aggregations (count, sum(amount), etc.).
whereClauseMScriptOptional advanced query.
bucketByPropReferOptional grouping key for bucketed results.
contextPropertyNameStringWhere 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