Overview
Use the Data API to bring data from your application into Unify. This guide creates awebsite_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 theUNIFY_API_KEY environment variable.
Create the object and attributes
Create the object and attributes once, either in Unify or through the Data API:1
Create the object
- In Unify
- Via API
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 Unify
- Via API
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
- In Unify
- Via API
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
Personwith API nameperson. Set it to reference one person. - On Person, name the attribute
Website form fillswith API namewebsite_form_fills. Set it to reference many form fills.
Upsert a form fill and its person
Use Upsert record each time your server receives a submission. This request matches the form fill bysubmission_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.