Integrate Typeform
Overview
The Typeform integration captures form submissions and records them as survey events in Bloomreach using Omniconnect. Use it to bring zero-party data, NPS responses, and other form inputs directly into your customer profiles.
Prerequisites
Before you set up the integration, you need:
- A Bloomreach project with integration access.
- A Typeform account with at least one form that includes a question collecting customer IDs.
- Basic JavaScript knowledge to configure the transformation function.
Configure the transformation function
The transformation function uses two variables. Update them to match your Typeform setup.
idKey
idKey is the name of the field that holds the ID you'll use for customer mapping — usually an email address. The default value is registered, which maps to Bloomreach's standard email identifier. Only change this if your Typeform collects a different type of ID, such as a custom customer number.
idQuestions
idQuestions is a list of question IDs from your Typeform form that collect a customer ID. This is required — if no ID is present in the submission, Bloomreach can't process or store it. If one of your questions collects an email, add its question ID here. If the list is empty, the function falls back to the first email input field in the form. If no email field exists, an error appears.
The webhook setup populates the input with a test payload from Typeform. Click Transform input to check the result.

Paste the transformation function into the Transformation Function panel, then click Transform input to verify the output.
Transformation function
The function creates one event for the form submission and one event for each question-and-answer pair. It returns one survey event per answer. Paste the full function into the Transformation Function panel. The only parts you need to customize are the idQuestions and idKey variables at the top — leave the rest unchanged unless you have specific requirements.
/**
* Params to be set to allow customization
* @param {Array} idQuestions - List of question ids where id is stored to use for customer identification
* @param {string} idKey - Field id where id is stored
*/
const idQuestions = ["OyreMH40gpaO"];
const idKey = "registered";
/**
* Handler is the entry point for the function that enables the transformation of the data.
* @param {object} data - The input data
* @returns {Array} - Array of transformed events
*/
function handler(data) {
const response = [];
const { form_response: formResponse } = data;
const timestamp = getTimestamp(formResponse.submitted_at);
const idValue = getIdValue(formResponse.answers);
const customerIds = {
[idKey]: idValue
};
response.push(returnEvent(getEventProperties(data, "submission"), customerIds, timestamp));
formResponse.definition.fields.slice(0, 50).forEach((field, index) => {
const answer = processAnswer(formResponse.answers[index]);
const properties = {
...getEventProperties(data, "answer"),
question: field.title,
question_id: field.id,
question_type: field.type,
question_index: index,
answer_type: formResponse.answers[index].type,
answer
};
response.push(returnEvent(properties, customerIds, timestamp));
});
return response;
}
/**
* Extracts id from the form response answers
* @param {Array} answers - The answers from the form response
* @returns {string | undefined} - The id or undefined if not found
*/
function getIdValue(answers) {
const idAnswer = answers.find(obj => idQuestions.includes(obj.field.id));
return idAnswer?.email || answers.find(obj => obj.type === 'email')?.email;
}
/**
* Process the answer based on its type.
* @param {object} answer - The answer object
* @returns {*} - Processed answer
*/
function processAnswer(answer) {
switch (answer.type) {
case 'date':
return getMiddayUtcTimestamp(answer.date);
case 'choice':
return answer.choice.label;
case 'choices':
return answer.choices.labels;
default:
return answer[answer.type];
}
}
/**
* Get the properties for an event.
* @param {object} data - The input data
* @param {string} action - The action type
* @returns {object} - Event properties
*/
function getEventProperties(data, action) {
const { form_response: formResponse } = data;
return {
action,
integration_name: INTEGRATION_NAME,
integration_id: INTEGRATION_ID,
survey_name: formResponse.definition.title,
survey_id: formResponse.form_id,
token: formResponse.token,
landed_at: getTimestamp(formResponse.landed_at)
};
}
/**
* Construct an event.
* @param {object} properties - Event properties
* @param {object} customerIds - Customer IDs
* @param {number} timestamp - Event timestamp
* @returns {object} - The event object
*/
function returnEvent(properties, customerIds, timestamp) {
return {
name: "customers/events",
data: {
customer_ids: customerIds,
event_type: "survey",
timestamp,
properties
}
};
}
/**
* Convert a string date to a timestamp.
* @param {string} stringDate - The string representation of the date
* @returns {number} - The timestamp
*/
function getTimestamp(stringDate) {
const date = new Date(stringDate);
return Math.floor(date.getTime() / 1000);
}
/**
* Convert a string date to a midday UTC timestamp.
* @param {string} dateString - The string representation of the date
* @returns {number} - The midday UTC timestamp
*/
function getMiddayUtcTimestamp(dateString) {
const date = new Date(dateString);
date.setUTCHours(12, 0, 0, 0);
return Math.floor(date.getTime() / 1000);
}Set up the Typeform integration
Create the integration
- Go to Data & Assets > Integrations > + Add new integration.

A Typeform account with at least one form that includes a question collecting customer IDs.
- Find Omniconnect and click + Add integration.
- Rename the integration and click Save changes.
- Go to the Transformation tab. You'll paste the transformation function here — see Configure the transformation function for the full code and setup instructions.

Open the Transformation tab and paste the transformation function into the Transformation Function panel.
Set up a webhook in Typeform
-
Go back to the Settings tab and copy the Omniconnect URL.
-
In Typeform, navigate to the form you want to connect.
-
Go to Connect > Webhooks > Add a webhook.

Go to Connect > Webhooks, then click Add a webhook to paste the Omniconnect URL.
- Paste the Omniconnect URL into the Webhook URL field and click Save webhook.
- Go to View deliveries and click Send test request. In the response payload, find the customer ID — this is the value you'll use to configure
idQuestionsin the transformation function. Note it down before moving to the next step.
Visit the Typeform documentation for details on webhook setup and delivery.
Limitations
The transformation function processes a maximum of 50 questions per form submission. Answers beyond the 50th question aren't captured.
Updated about 2 hours ago
