In this video, we’ll show you how to build forms that can create or update multiple records in your database. This will help you gather information and create relationships between different records, without doing all the work yourself.
Before we jump in, let’s look at an example so you can see how these forms work. Say you’re a veterinarian, and you want to save information about a furry patient and its owner in separate records. This is a great idea since lots of people have more than one pet. A multi-object form lets you establish that “pet” record and the “pet owner” record — with one form submission.
As you can imagine, this can really be a game-changer for all kinds of businesses. An auto shop might use multi-object forms for customers who own multiple cars, and an online education platform can keep track of parents who have multiple students enrolled.
I’ll show you how to build a multi-object form in three quick steps. First, we’ll build the form in Ontraport Pages and Ontraforms. Then, we’ll add fields to the form and publish it. We’ll wrap up by testing your new form to make sure it’s ready for action.
Let’s jump in.
Before doing anything, you’ll need to set up your custom objects and the relationships between them. We won’t be covering how to do this in this video, so if you’re not sure what to do, check out our videos about custom objects.
Once your custom objects are all set, you’re ready to get started!
First, we’ll build the form.
The main thing you need to understand for ALL form builders, is that even though we’re adding multiple objects to these forms, each form in Ontraport is built for ONE primary object. That is, you might build a “contact” form, or a “pets” form, or a “cars” form, or a “car owners” form.
So when you want a form that creates TWO related records, you’ll need to figure out which object is the “Child” and which one is the “Parent.” You always want to build the form for the object that is the “Child.”
I know, this sounds a little strange — but it really starts to click when you look at specific examples. For instance, if you’re a vet who wants to create objects for “pets” and “owners,” the “pet” would be the child and the “owner” would be the parent. In that case, you’d build your form in the “pet” object.
The same goes for an auto shop — if you’re working with “car” and “car owner” objects, the “car owner” would be the parent and the “car” would be the child, which means you’ll build your form in the “car” object.
One more tip: What I’m about to show you will only work if the relationship between your objects is “one to one” or “one to many'' — but not “many to many.” An example of a “many to many” relationship would be keeping records of “surveys” and “respondents,” where each survey will have many respondents and each respondent may fill out multiple surveys. There are ways to take care of these situations, but they’re beyond the scope of this video. Also, if the relationship is a “one to one” relationship, you can build a multi-object form from either object.
Once you’ve determined which object you’re going to build the form in, it’s easy to get started.
If you’re working in Ontraport pages, you can pick your primary object when you first drop a field onto the page.
If you’re in Ontraforms, just create the form under the primary object. So if your object is “pets,” you’ll do that here.
Great! Now that we’ve built the form, it’s time to start adding fields to it
You’ll need to add at least one field for each object you want to create. For example, our vet might want to know the pet’s name, what type of animal it is, and the pet owner’s name and email address.
We’ll start by adding the “pet” fields, as usual.
Then, we can add the parent fields — in this case, those will be our “Pet owner” fields. You can do this by clicking the arrow next to the parent in the drop down. Then you can drill into that relationship and see all fields for the related “Pet owner” object. All you need to do is select the field you want to display on the form, then repeat the process until you’ve added all the fields for your related object.
The rest is easy — just add a “Submit” button and configure your form settings as usual.
That’s it! Publish your form and we're almost home free.
To make sure everything works properly, give your form a test run.
You can see that Fluffy here is a dog, and Rosa is her owner. If you take a look at either object record, you’ll see exactly how they’re related.
Congratulations! Now you know how to build multi-object forms. We’re coming up on the last video in this section — you’ll be an Ontraport pro in no time. To wrap things up, let’s dive into Form Settings and our advanced Form features.