Examples

Following is the sample event payload of the Leads Created event from the Zoho CRM service in Catalyst Signals.

Sample Event Payload

    
Sample Event Payload
copy
{ "rule_id": "123456789", "target_id": "98765432", "version": 1, "attempt": 1, "account": { "org_id": "85512289", "project": { "environment": "DEVELOPMENT", "name": "crm", "id": "10666000000021013" } }, "events": [ { "data": { "Owner": { "name": "Owner name", "id": "9876543210", "zuid": "654321" }, "Company": "Company", "Email": "test@zoho.com", "Lead_Status_Prediction": "value of picklist", "Last_Activity_Time": "2024-01-01T12:00:00+00:00", "Industry": "value of picklist", "Unsubscribed_Mode": "value of picklist", "Street": "Street", "Zip_Code": "Zip Code", "id": 9876543210, "Data_Source": "value of picklist", "Enrich_Status__s": "value of picklist", "Created_Time": "2024-01-01T12:00:00+00:00", "Change_Log_Time__s": "2024-01-01T12:00:00+00:00", "City": "City", "No_of_Employees": 1, "Data_Processing_Basis": "value of picklist", "Converted__s": true, "Converted_Date_Time": "2024-01-01T12:00:00+00:00", "Converted_Account": { "name": "lookup name", "id": "9876543210" }, "State": "State", "Country": "Country", "Created_By": { "name": "Owner name", "id": "9876543210", "zuid": "654321" }, "Annual_Revenue": 100, "Secondary_Email": "test@zoho.com", "Description": "Description", "Rating": "value of picklist", "Website": "https://catalyst.zoho.com", "Twitter": "Twitter", "Salutation": "value of picklist", "First_Name": "First Name", "Full_Name": "Full Name", "Lead_Status": "value of picklist", "Modified_By": { "name": "Owner name", "id": "9876543210" }, "Lead_Conversion_Time": 1, "Skype_ID": "Skype ID", "Phone": 9876543210, "Email_Opt_Out": true, "Designation": "Designation", "Modified_Time": "2024-01-01T12:00:00+00:00", "Lead_Status_Prediction_Score": 1, "Unsubscribed_Time": "2024-01-01T12:00:00+00:00", "Converted_Contact": { "name": "lookup name", "id": "9876543210" }, "Mobile": 9876543210, "Last_Name": "Last Name", "Locked__s": true, "Lead_Source": "value of picklist", "Tag": "Tag", "Fax": "Fax", "Last_Enriched_Time__s": "2024-01-01T12:00:00+00:00" }, "id": "c6b53699-94b1-48a1-86fd-80b8d4778e28", "time_in_ms": 1718780819204, "source": "publisher_id:10666000000021074/service:zohocrm/account:73756307", "event_config": { "api_name": "Leads Created", "id": "10666000000021075" } } ] }
View more

With the help of this sample event payload, let us walk you through two mostly used transformation patterns for your targets.

Scenario 1: Simple Transformation

Let’s perform a basic transformation of adding a new key-value pair and modifying the existing ones for only a particular indexed object in an array.

New Payload Requirements

  • To retain the existing keys like Event ID, Lead ID, and Email.
  • To add this “is_transformed”: true new key-value pair.
  • To retain the Lead’s full name in a different key called Name.

Expected Event Payload

    
Expected Event Payload
copy
{ "id" : 9876543210, "name" : "Full Name", "email" : "test@zoho.com", "event_id" : "c6b53699-94b1-48a1-86fd-80b8d4778e28", "is_transformed" : true }
View more
  1. 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.
Simple transformation of an event body
  1. 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.
Simple transformation of an event body

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.

    
Template Compiler
copy
{ "id" : $.events[0].data.id, "name" : $.events[0].data.Full_Name, "email" : $.events[0].data.Email, "event_id" : $.events[0].id, "is_transformed" : true }
View more
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.

Expected Event Payload

    
Expected Event Payload
copy
{ "data" : [ { "id" : 9876543210, "name" : "Full Name", "email" : "test@zoho.com", "event_id" : "c6b53699-94b1-48a1-86fd-80b8d4778e28" } ], "is_transformed" : true }
View more
  1. 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.
Complex transformation of an event body
  1. 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.
Complex transformation of an event body

This will iterate through each object starting from index 0 and generate an array of objects containing lead names, IDs, and Emails.

  1. 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.
Complex transformation of an event body

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.

    
Template Compiler
copy
{ "data" : $.events.forEach((event) -> { "id" : event.data.id, "name" : event.data.Full_Name, "email" : event.data.Email, "event_id" : event.id } ), "is_transformed" : true }
View more

Last Updated 2025-04-11 18:35:15 +0530 +0530