You set up relationships when you create a custom object. But your data keeps changing. A customer registers for an event. A member favorites a post. A new client gets an account manager. In this lesson, you'll see how to manage relationships between objects, and how to connect and disconnect records by hand, with forms, with automations, and more.
To manage an object's relationships, click your profile icon, then Administration. Open Data, click Custom Objects, and click your object. On the Manage Relationships tab, you can add relationships the same way you did when you created the object, including relationships with users, like an account manager. You can edit a relationship's name at any time, and add an optional description.
Each relationship adds relational fields to your records. You can't edit or delete those in the Field Editor. To get rid of one, you delete the relationship that created it.
On a record, connecting is quick. In a relational field, on a child record or in a one-to-one relationship, click into the field and pick the record. On a parent record, click Add in the subcollection and pick the child. Many-to-many relationships have a subcollection on both records, so you can click Add from either side.
To connect several records at once in a many-to-many relationship, go to the object's collection and select the records. In the action bar, click Update relationships, choose the relationship, and pick the records to connect them to.
Subcollections are also where you act on related records. A parent's subcollection gives you the same actions you'd have in the collection. In a many-to-many subcollection, the only action is to remove the relationship. That's how you disconnect those records by hand.
Forms can create records and connect them in one step, as you saw in the Multi-object forms lesson. For one-to-one and one-to-many relationships, you drill into the related object's fields, and that works with hidden fields too. For many-to-many, use the form setting Update relationships on form submission, under Advanced Settings.
When a form touches records you already have, you want it to update them, not create duplicates. Custom objects start with only system fields, so there's no email to go by. If you need a way to identify records, make a field unique, so no two records can share a value, like a permit number. Hover over your object, click Settings, then Field Editor, and choose unique when you add the field. Only do this for a specific need, since automations and group actions can't change unique fields. On dynamic templates and blocks, forms also offer Merge form submissions with a specific record. It updates an existing record instead of creating a new one, without a unique field.
Automations can connect records too. For one-to-one and one-to-many relationships, add an update element, like Update contact. Open the Update this field dropdown, and choose the relationship. Then pick the record to connect. You can't set relationships dynamically, so you choose one specific record, like assigning your VIP account manager to every new high-value client. And don't drill into the related record's fields, unless you mean to update those fields instead of creating a relationship.
For many-to-many, use the Update relationship element. Choose the relationship in the Relationship(s) with dropdown, click Add, and pick the records. For example, you could add every new community member to your general group.
Relationship changes can also start automations. The trigger and goal called A relationship is added or removed fire when you add or remove a many-to-many relationship on a contact's record. And the condition Relationship does or does not exist limits them to contacts who do, or don't, have a specific related record.
On your website, Reactions let members manage relationships themselves. A reaction button adds or removes a many-to-many relationship with a click, like favoriting a blog post or upvoting a forum post. You set what each click does under Add/remove relationships. Reaction buttons go on dynamic templates or blocks published on an Ontraport membership site, and only logged-in members can use them.
You can also import records with their relationships. Hover over your object in the main navigation, then click Settings, then Import. Add a column to your CSV with the name of the related record. At step 4 of 5, match that column by drilling into the related object and choosing its name field. Each import can only go one level deep, so import more complex relationships in two steps. And developers can manage relationships through Ontraport's API.
So: manage an object's relationships on its Manage Relationships tab, connect records by hand from relational fields and subcollections, and automate it all with forms, automations, reactions and imports. That wraps up custom objects. Next up: the Dynamic CMS overview, where you'll start using your data to build personalized pages.