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:
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:

Make sure to paste the SESSION id and not the event id. ðŸ‘Œ

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:

  • 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 hubspot = require('@hubspot/api-client');
const axios = require('axios')
exports.main = async (event, callback) => {

//Get contact properties
const email = event.inputFields['email'];
const firstName = event.inputFields['firstname'];
const lastName = event.inputFields['lastname'];
//ADD Custom properties here
/*const customProperty = event.inputFields['hubspot_custom_property'];*/
  
//Get API Key
const apiKey=process.env.APIKey;
  
//Get Session ID
const sessionId=event.inputFields['livestorm_session_id'];
  
var 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":customProperty}*/
                  ]
                }
  	 }
             };
 
const headers={
    Accept: 'application/vnd.api+json',
    'Content-Type': 'application/vnd.api+json',
    Authorization: apiKey
  };

//POST Registrant to Session 
 
axios.post('https://api.livestorm.co/v1/sessions/'+sessionId+'/people', body,{headers: headers})
  .then(function(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).
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).
6
If your workflow looks like below, then you're ready to activate it in the top right corner. ðŸŽ‰

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.

Join our On-Demand Product Training

During this 1h-training session, we will cover everything you need to know to manage your online event, from the event creation to hosting them live, and analyzing your participation data afterwards.