Newer Version Available

This content describes an older version of this product. View Latest

Build Context Action

Build and cache context data associated with a context definition.

This action is available in API version 59.0 and later.

Special Access Rules

Available in Developer, Enterprise, Professional, and Unlimited editions for Industries clouds where Context Service is enabled.

Supported REST HTTP Methods

URI
/services/data/v65.0/actions/standard/buildContext
Formats
JSON, XML
HTTP Methods
POST
Authentication
Authorization: Bearertoken

Inputs

Input Details
contextData
Type

string

Description
Optional. JSON data that's used to build context data.
contextDefinitionId
Type

string

Description
Required. The ID or developer name of the context definition record that's used to build context data.
contextMappingId
Type

string

Description
Optional. The context mapping record ID or name that identifies which Salesforce object and mappings to use for building context data.
isTaggedData
Type

boolean

Description
Optional. Indicates whether the associated context node is tagged with a key (true) or not (false).

Outputs

Output Details
contextDefinitionId
Type

string

Description
The ID or Developer Name of the Context Definition record that was used to build context data.
contextId
Type

string

Description
ID of the cached context data.
contextMappingId
Type

string

Description
The Context Mapping record ID or Name that identifies which Salesforce object and mappings to use for building context data.

Usage

Build context invocable action is a wrapper over Build Context business API. The API fetches the data passed in request and saves the data to the cache. This is useful when the same data is required in multiple steps of the process.

Example

POST

This sample request is for the Build Context action. In this example, we are inserting new records to hydrate input values (input hydration). To use existing records instead, reference the IDs directly rather than providing full record data.

1{
2  "inputs": [
3    {
4      "contextDefinitionId": "AccountContextDef",
5      "ContextData": {
6        "Account": [
7          {
8            "id": "account1",
9            "businessObjectType": "Account",
10            "Name": "AcmeFlow",
11            "Contact": [
12              {
13                "id": "contact1",
14                "businessObjectType": "Contact",
15                "FirstName": "John",
16                "LastName": "Miller",
17                "ParentReference": "account1"
18              }
19            ]
20          }
21        ]
22      },
23    "contextMappingId": "accountmap1",
24    "isTaggedData": false
25    }
26  ]
27}

This sample response is for the Build Context action.

1{
2  "actionName": "buildContext",
3  "errors": null,
4  "invocationId": null,
5  "isSuccess": true,
6  "outputValues": {
7    "contextDefinitionId": "11Oxx0000006PXVEA2",
8    "contextId": "0000000a07da091002517526756248297be68492e6b442e8ad80182d518e45aa",
9    "contextMappingId": "11jxx0000004L59AAE"
10  },
11  "sortOrder": -1,
12  "version": 1
13}