A trigger takes place in another app while an action is an action we take on another app. Now, with the introduction of objects, you can map data between trigger and actions in a single click.
Objects simplify and automate the template creation process. The number of templates you create for your app is greater than the number of activities you create in it. A single activity can be used in a number of integrations, so we automated mapping and sped up the template creation process. Now both developers and non-developers can create templates faster, without going into mapping details.
No matter how many activity fields an action has, all of these fields can be mapped by a single click. This article will walk you through an example of how to map data using objects.
Mapping Data between Activities using Templates and Objects
Under the Templates tab in your dashboard, you can view the existing templates and also create a New Template. Learn here, how to add triggers and actions in a new template.
Let’s say you create a new template. You add a trigger, “Contact Created” in MailChimp. The output object of the trigger is a Contact Object. Learn here, how to add an output object in your activity. The output object of “Contact Created” is the Contact Object. So, the attributes of this object will be available to the action with Input Object: Contact.
Now we add the action, “Create Contact” in HubSpot. The action will take Contact Object as input. Learn here, how to add the input object in an action. This action anticipates receiving the contact object from the Contact Created, trigger. As soon as you select the action for the template, you can view the following form.
You can view the name of the action. Below it, a field displays the list of triggers whose output can be used as Contact Object Input for this action. Step refers to the trigger you can use. You can see a drop-down that displays the trigger, “Contact Created” in MailChimp, as step 1.
The field only displays those triggers which output the same object as the input object of the action, other triggers do not appear. This is where the actual relationship between the trigger and action come into existence.
Once you select the Step - trigger, “Contact Created”, the activity fields of the action are auto-filled. They map the output of the trigger with the action’s activity field as shown below.
The fields First Name, Last Name, and Email are automatically filled with tags. The tags that are generated, depending upon the step you select.
Note: When you create an action and add an Input Object in it, an extra field appears in the activity fields of the action to configure Input Object attributes.
Scenarios where Objects cannot be mapped between Activities
Let us take an example, where we add a trigger that outputs the Contact Object but the action takes a different object, say, Task Object as the Input Object as shown below.
So, when you add a trigger and an action that does not use the same object, the Select a step field does not appear. You need to map data via Tags.
There is another scenario, where the trigger outputs the Contact Object but the action does not take any input object. In this case, the field Select a step does not appear as above. In this case, map the trigger and activity fields’ data via Tags.
These objects help us to make Templates more intelligent so the user doesn’t get confused with mapping or other details.