Map Your HubSpot Properties Into Livestorm

Map Your HubSpot Properties To Livestorm#

This process is only available for "Operation Hub Professional" and "Operation Hub Enterprise" HubSpot plan customers.

1 Following the same process as for the previous section, create a custom property to your HubSpot contacts for every data point you would like to pass from HubSpot to Livestorm, using this format:

  • "Custom property" (single-line text).

2 Sames as before, create a new Blank Workflow, and set the completion of your form as the trigger:

Set-up triggers screenshot

3 If you are using the dynamic approach in which you added the session ID as the default value in the Livestorm Session ID hidden field in your form, then proceed to the next step. Otherwise add an action Set property value  and set "livestorm_session_id" to the ID of the session you want to connect to:

Set property value with target object

Make sure to paste the SESSION id and not the event id. 👌

Copy session ID screenshot

The API token must be created with " Write" scope permissions (full read and write access).

4 Add an action Custom code:

  • In Secrets, click on Choose secret, and then on Add secret. In the field "Secret name", type "API_Key" and in the field "Secret Value", type your Livestorm API Key. It should look similar to this:

API credentials screenshot
  • In Property to include in your code, add "livestorm_session_id" as well as all the potential custom properties you need to map between your HubSpot registration form and Livestorm registration. You will need to include at least the Email, First Name, and Last Name of the contact.

  • Add the following code:

const axios = require('axios')

exports.main = async (event, callback) => {
  //Get contact properties
  const { email, firstname, lastname, livestorm_session_id: sessionId } = event.inputFields;
        
  const body = {
    data: {
      type: "people",
      attributes : {
        fields: [
          {
            id: "email",
            value: email,
          },
          {
            id: "first_name",
            value: firstname,
          },
          {
            id: "last_name",
            value: lastname
          },
          // Map Custom properties here
          /*
          {
            id: "livestorm_custom_property",
            value: event.inputFields['hubspot_custom_property']
          },
          */
        ],
      },
    },
  };
  
  const headers = {
    'Accept': 'application/vnd.api+json',
    'Content-Type': 'application/vnd.api+json',
    'Authorization': process.env.APIKey,
  };

  // POST Registrant to Session 
  axios.post(`https://api.livestorm.co/v1/sessions/${sessionId}/people`, body, { headers })
    .then((response) => {
      callback({
        outputFields: {
          contact_connection_link: response.data.data.attributes.registrant_detail.connection_link,
        },
      });
    })
    .catch(err => console.error(err));
}
  • In Data output, add a string "contact_connection_link" (only necessary if you need to store the access link in HubSpot).

Add Livestorm Registrant

5 Add an action Copy property value, and copy "contact_connection_link" to contact's property "livestorm_connection_link" (only necessary if you need to store the access link in HubSpot).

Add an action

6 If your workflow looks like below, then you're ready to activate it in the top right corner. 🎉

Contact enrollment trigger and workflow

7 For your next integrations, you can just clone this workflow and:

  • Change the trigger by changing the form and/or the page in the first step of the workflow.

  • Change the session ID in the second step.

How to clone a workflow

Join our Livestorm Live Product Demo

During this 30-minute live event, we will introduce you to the platform. You will learn how to use Livestorm for your webinars and online meetings.