Open a JSON object and add the “id” key, providing the JSON path of the corresponding key in the sample event payload instead of value. Repeat this step for the “email” and “event_id” key.
For the “name” key, provide the JSON path of the Full_Name key in the sample event payload. Finally, add this “is_transformed”: true static key-value pair to denote that this payload is transformed to suit the orchestration configured for the particular event.
You can also copy and paste the below template compiler for the Lead Created event in Zoho CRM service to witness the instant transformation of your payloads.
Note: This applies only to the first indexed JSON object in the events array.
Scenario 2: Complex Transformation
For the same requirements that we have seen in the above scenario, we need to apply the transformation to each and every JSON object within the events array instead of a particular indexed object.
New Payload Requirements
To have an array of JSON objects called data.
Each JSON object in the array should carry the id, name, email, event_id keys as transformed in the previous scenario.
To add this “is_transformed”: true new key-value pair.
To create an array, begin by opening a JSON object with the data key. Provide the JSON path of the events array from the sample payload and deploy this forEach((var{n})->{JSON_path_of_desired_key} ) syntax instead of values. Replace var with the a variable name.
Enter the name of the keys (id, name, email, event_id) that you want to include within an object of this array. Instead of values, provide the JSON path of the corresponding keys from the particular array without the $ symbol.
This will iterate through each object starting from index 0 and generate an array of objects containing lead names, IDs, and Emails.
Add this “is_transformed”: true static key-value pair to denote that this payload is transformed to suit the orchestration configured for the particular event.
You can either practice this transformation step-by-step, or copy and paste the below template compiler for the Lead Created event in Zoho CRM service to witness the instant transformation of your payloads.