Tasks
Merge Object
Stores complex JSON objects and multiple data points into `stub.data` in a single task using a JSON structure.
Basic usage
The merge_object task is ideal for scenarios where you need to modify existing data or insert new data into the stub.data object. This allows you to accumulate and structure information that can be used in subsequent workflow steps. Whether you're updating a single field (like a phone number) or adding complex, nested JSON objects (such as a candidate profile), this task ensures that data is consistently merged into stub.data. This improves data continuity and enables efficient reuse of critical information across multiple tasks.
Example of how this task might look:
Parameters
merge_data required json
The data structure you wish to store in stub.data.
You can define any JSON data element, including objects, arrays, or standard key–value pairs.
Result
Properties
merge_data
A JSON object that contains the final output of the Merge Object task after data substitution, representing the values as they would be merged into stub.data.
Example 2
In this example, we have an action on a template that updates a stub’s details. The information we want to manually update includes the cell number and email address of a specific person.
Within the action, we first capture the two fields we want to update. Once updated, they are saved to:
stubpost.data.telephone_fieldstubpost.data.email_field
We now want these fields to replace the existing values stored at:
stub.data.candidate_details.cell_numberstub.data.candidate_details.email_address
To achieve this, we add a merge_object task and configure it as follows:
Explanation
cell_number: References the updated cell number stored in stubpost.data.telephone_field. When the merge runs, this value overwrites the previous stub.data.candidate_details.cell_number.
email_address: References the updated email stored in stubpost.data.email_field. This value overwrites the previous stub.data.candidate_details.email_address.