In a two-way sync, data flows between two applications in both forward and backward directions. From the source app to the destination app and from the destination app to the source app. For example, a two-way sync between vFairs and HubSpot means that data flows from vFairs to HubSpot and from HubSpot to vFairs. The flow of data from vFairs to HubSpot will be forward and from HubSpot to vFairs will be backwards.
In this example, we'll create a flow, "When an attendee is created in an event in vFairs, create a contact in HubSpot and when a contact is created in HubSpot, create an attendee in an event in vFairs" to sync data two ways.
-
- Log in to your Integry account.
- Go to the Flows tab from the top menu.
- Create a new flow.
- Select vFairs.
- Add the trigger "Attendee Created."
- Click "Add My Account."
- You will see a window according to the auth type of the app used. If the app supports API Key authorization, you will see a pop-up as follows. Enter your API Key in the pop-up window and click Proceed.
- You can check the box 'Update Attendee' to update the vFairs attendee if it already exists in the third-party app.
- This is not a required field and hence can be skipped. Click Continue.
- This is not a required field and hence can be skipped. Click Continue.
- Click Test.
- Go to your vFairs account and create an attendee there. Then come back to the Flow Builder and press Start.
- Integry will receive a trigger from vFairs for the attendee created and your test will be successful.
- Trigger 1 is the received trigger from vFairs. Click to view payload.
- You can carry out the polling of trigger again by clicking "Poll again" or click Done to proceed.
- Trigger 1 is the received trigger from vFairs. Click to view payload.
- Search and select HubSpot.
- Select the "Create Contact" action.
- Click "Add My Account."
- As HubSpot supports OAuth type authorization, you will see a modal where you can choose the account you want to connect.
- Allow Integry to connect and access your HubSpot account.
- Enter the contact's email address, first name, last name in the respective fields. You can add dynamic tags of fields coming in from the Attendee Created trigger here. Learn more about how to add dynamic tags here.
- Map the additional fields of HubSpot with vFairs fields. These are the fields available for mapping including custom fields as well as other non required fields being fetched dynamically from the user's account.
- This is not a required step so it can be skipped.
- This is not a required step so it can be skipped.
- Select the List to which you want to add the contact and then click Continue.
- Click Test.
- You will see a success message if the contact is created successfully in HubSpot. Click 'Test Result' to view the payload.
- Click Done.
Second flow- Reverse map usage
Now we will be adding another flow to reverse the mapping of fields from HubSpot to vFairs.
- We will use the Reverse Map action of JSON step to store and reverse the vFairs to HubSpot mapping received from the user. The attendee data from vFairs and contact data from HubSpot is saved in the JSON objects.
- Click on the three-dots menu on the far right corner of the trigger step and then click "Add Step."
- Add "Contact Created" trigger in HubSpot following the above steps 4 and 5.
- You don't need to connect your HubSpot account again as it is already connected.
- Select the list you want to monitor for newly added contacts and click Continue.
- You can test this trigger by following steps 9-11.
- Click Done.
- Search and select "JSON" in the child step. Using the JSON objects, you'll map vFairs' fields with HubSpot's fields.
- Select the "Reverse map" action.
- The attendee data from vFairs and contact data from HubSpot is saved in the JSON objects.
- You will use the JSON objects for the mapping between fields from HubSpot and vFairs.
- We need to map the fields in the reverse direction using Reverse map so that the user doesn't have to do so while creating an integration.
- Enter the JSON value of the fields of HubSpot.
- Click on the '+' button on the far right of the JSON field.
- Click on 'Create Contact.'
- Click on the index of 'In' to view the fields received from vFairs.
- Click to add the "custom_fields" tag to the field. We are adding this tag here to achieve reverse mapping of custom fields from HubSpot.
- Enter the specific value or set of values that you want to prepend to the JSON added above.
- Whatever value you add here will be automatically prepended to the JSON object. For example, you can add "contact_v1.custom_fields" here to prepend it to each attribute's key inside the JSON Object.
- Leave it empty if you don't want to add any values.
- Enter the specific value or set of values that you want to remove from the array of data received above in JSON. For example, you can remove "contact_v1.custom_fields" from the JSON object.
- This is not a required field and can be left empty.
- This is not a required field and can be left empty.
- Click Test.
- Add a "Create Attendee" action in vFairs following steps 12 to 14.
- You don't need to connect your vFairs account as it is already connected.
- Add the output of the Reverse map step so that all the fields of the contact are automatically mapped in opposite direction i.e. from HubSpot to vFairs.
- The user won't have to map HubSpot fields to vFairs fields while setting up the integration.
- Click Continue.
- You can test this action by following steps 20 and 21.
- Turn on the "Loop Prevention" toggle from the Flow Behavior settings on the right side of the Flow Builder screen to enable a two-way sync.
- Save and publish your flow.
You users will be able to set up integrations using the above flow. They will only map vFairs fields with HubSpot fields during integration set up; Integry will save that mapping and reuse it to map HubSpot fields with vFairs using the Reverse map action.
A contact will be added to their HubSpot account each time a new attendee is added to an event in vFairs and vice versa.
Comments
0 comments
Please sign in to leave a comment.