Skip to main content

Overview

Use the Data API to bring data from your application into Unify. This guide creates a website_form_fill object, sends a form submission with its related person, and uses that relationship to find people for a play. Each form fill belongs to one person. A person can have many form fills, so repeat submissions remain separate records.

Before you begin

Generate an API key and set it as the UNIFY_API_KEY environment variable.
This guide uses a sensitive API key. Use it only in backend or server-side applications. Never expose it in frontend or client-side code.

Create the object and attributes

Create the object and attributes once, either in Unify or through the Data API:
1

Create the object

Open Settings → Data management and click New object. Enter Website form fills as the object name and website_form_fill as the API name, then click Create object.
2

Add the submission attributes

In the object’s Attributes tab, click Create attribute and choose Text. Create these two attributes:For Submission ID, select Make attribute required and Make attribute unique. Leave both options off for Form name. Click Create attribute to save each attribute.
3

Reference the person

Click Create attribute, choose Relationship, and select Person as the related object. Configure the two sides as follows:
  • On Website form fills, name the attribute Person with API name person. Set it to reference one person.
  • On Person, name the attribute Website form fills with API name website_form_fills. Set it to reference many form fills.
Click Create attribute. The reverse reference lets you filter people by their submissions.

Upsert a form fill and its person

Use Upsert record each time your server receives a submission. This request matches the form fill by submission_id and the person by email. It creates either record if needed and connects them through the person reference.
create_or_update replaces the form fill’s values when the submission already exists. The nested create_or_update_if_empty preserves the person’s existing name while filling missing values. You do not need to look up the person’s Unify ID first. Reuse the submission ID when retrying a request. Use a new ID for each new submission, even when the same person submits the form again.

Trigger a play for matching people

Create a play with a Record matches criteria trigger and choose People. Use the Website form fills reference to filter for people with a related record whose Form name is “Request a demo”. The trigger returns people, so you can connect it directly to a person action, such as enrolling them in a sequence. See play triggers for the full setup. By default, a person runs through a play once, even if they submit multiple forms. Play settings control when they can run again. Matching people can enter when you publish the play and on subsequent scheduled checks.