ThingWorx Flow > Creating and Managing Workflows > Mapping Output of a Previous Action Manually
Mapping Output of a Previous Action Manually
If you do not see a specific output attribute in the output schema of an action that you want to map as an input to another action, then you need to manually map that output attribute to the input field. For example, if you want to map the Owner ID attribute of the Get Records action of Salesforce to the Value field in the Update Record action, then you need to perform the mapping manually.
The following table provides step-by-step instructions to perform mapping manually, with the corresponding steps for the above example:
Step
Task
Corresponding Example Task
1
Search the output schema for the attribute that you want to map as an input to another action.
The output schema of the Get Records action of Salesforce is as shown below:
In this output schema, the Owner ID attribute is not available.
2
Search for the exact attribute name and its position in the output of the action in the Debug Panel.
Search for the exact name and position of the Owner ID attribute in the output of the Get Records action of Salesforce in the Debug Panel.
{
"totalSize": 2,
"done": true,
"records": [
{
"attributes": {
"type": "Account",
"url": "/services/data/v44.0/sobjects/Account/0011I00000jmFCvQAM"
},
"Id": "############",
"Site": null,
"OwnerId": "************",
...
}
{
"attributes": {
"type": "Account",
"url": "/services/data/v44.0/sobjects/Account/0011I00000jmomyQAA"
},
"Id": "############",
"Site": null,
"OwnerId": "************",
...
}
]
}
The Owner ID attribute is called OwnerId and is part of the records array.
3
If your attribute is part of an array, then map the top-level array object to the input field.
If your attribute is not part of an array, then map any output to the input field.
Since the OwnerId attribute is part of the records array, map the value of Records to the Value field of the Update Record action.
4
If your attribute is part of an array, then append [ArrayIndex] to the array name.
If your attribute is not part of an array, then skip this step.
In this case, append [0] to the array name, records. The updated value must be records[0].
5
If your attribute is part of the array, append a ‘.’ and the exact attribute name to the mapped array object output.
If your attribute is not part of an array, then replace the mapped attribute name with your attribute name.
Append .OwnerId to the array name, records[0]. The updated value must be records[0].OwnerId.
You have successfully mapped an output attribute that is not available in the output schema of an action to an input field of another action.
Mapping Syntax
With respect to the output schema for the Get Records action, the following table provides information about the mapping syntax:
Scenario
Mapped Attribute and Mapped Value
Syntax
Map an individual attribute
When you map Total Size, the mapped value is {{$a0.totalSize}}.
{{$ActionID.AttributeName}}
Map an array
When you map Records, the mapped value is {{$a0.records}}.
{{$ActionID.ArrayName}}
Map an individual attribute of an array
When you map ID, the mapped value is {{$a0.records[0].Id}}.
{{$ActionID.ArrayName[ArrayIndex].AttributeName}}
Map an object attribute of an array
When you map Records Attributes, the mapped value is {{$a0.records[0].attributes}}.
{{$ActionID.ArrayName[ArrayIndex].ObjectName}}
Map an attribute of an object inside an array
When you map Attributes Type, the mapped value is {{$a0.records[0].attributes.type}}.
{{$ActionID.ArrayName[ArrayIndex].ObjectName.AttributeName}}
Retrieve the AttributeName, ArrayName, ArrayIndex, and ObjectName from the output of the action in the Debug Panel.
* 
Any attribute that does not appear in the output schema is an unsupported attribute, and PTC does not guarantee the consistency or presence of the value of such an attribute in the output.
Was this helpful?