Action ReferencesFetchObjectAction
Action References

FetchObjectAction

FetchObjectAction

Purpose Fetches one or more records from another Data Object (local or foreign) and writes the result into context. Used for enrichment, lookups, or pre-validation based on related entities.

When to use it Typical milestones:

  • afterBuildWhereClause or afterFetchInstance (update/delete)
  • afterMainGetOperation (get)
  • afterMainListOperation (list enrichment)

Key fields

FieldTypeDescription
targetObjectDataObjectNameName of the Data Object to query.
matchValueMScriptValue to match (e.g., this.customerId).
localKeyPropReferTarget object property to match against (default id).
whereClauseMScriptOptional advanced query (replaces simple match).
properties[PropRefer]Fields to return (omit for all).
isArrayBooleanfalse → single record, true → list.
contextPropertyNameStringResult is written to this.<name>.

Behavior Mindbricks executes the lookup before continuing the milestone chain. If isArray=false but multiple matches are found, only the first is stored. The returned record(s) are available for later actions or response shaping.

Example

{
  "id": "a10-fetch-customer",
  "name": "fetchCustomer",
  "targetObject": "customer",
  "matchValue": "this.customerId",
  "localKey": "id",
  "properties": ["id", "name", "email"],
  "contextPropertyName": "customer"
}
Was this page helpful?
Built with Documentation.AI

Last updated Jan 3, 2026