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:
afterBuildWhereClauseorafterFetchInstance(update/delete)afterMainGetOperation(get)afterMainListOperation(list enrichment)
Key fields
| Field | Type | Description |
|---|---|---|
targetObject | DataObjectName | Name of the Data Object to query. |
matchValue | MScript | Value to match (e.g., this.customerId). |
localKey | PropRefer | Target object property to match against (default id). |
whereClause | MScript | Optional advanced query (replaces simple match). |
properties | [PropRefer] | Fields to return (omit for all). |
isArray | Boolean | false → single record, true → list. |
contextPropertyName | String | Result 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