Overview
A standard use-case while using forms is the ability to use a single form to create or update multiple contact records in Campaign Studio. This use-case is applicable to business referrals, partner deal registrations, and sending e-cards, etc.
To use this feature, you must perform the following two primary steps:
Creating forms
To use one form for multiple contacts, you must create two forms in Campaign Studio. While a single form appears on your website or landing page, the system shares data with the other form. Hence, you will receive two form submissions even though a contact submits only one form.
The parent form contains all the fields that you want a person to see on your landing page or website, including fields for the form-submitter and for the second contact you want to have created or updated.
You do not need to map all form fields to a contact record. However, if you want to track information for the referrer on the referee’s record, you may want to create custom fields for that data and map the form fields to those contact fields.
To illustrate the process, let us consider that you will create two forms. The first form contains seven fields while the second form contains three fields.
To create the first form:
Log in to Campaign Studio.
In the left navigation pane, click Components > Forms.
Click +New.
Set a name for the form and enter the relevant details.
In Fields, create the following fields:
Contact 1 First Name
Contact 1 Last Name
Contact 1 Email
Contact 2 First Name
Contact 2 Last Name
Contact 2 Email
FormID
Note
You cannot completely configure the
FormID
field until you create the second form. For more information, see Creating FormID field.Map the first three fields for Contact 1, such as
Contact 1 First Name
,Contact 1 Last Name
, andContact 1 Email
to the appropriate fields under the Mapped Field tab in the form field editor. For example, theContact 1 First Name
field should be mapped toFirst Name
.Ensure that you leave the last four fields unmapped.
Save the first form.
To create the second form:
Access the same instance where you have created your first form.
In the left navigation pane, click Components > Forms.
Click +New.
Set a name for the form and enter the relevant details.
In Fields, create the following fields:
Contact 2 First Name
Contact 2 Last Name
Contact 2 Email
Tip
You may achieve this quickly by cloning the first form and deleting all but the above fields from that form.
Map these three fields for Contact 2 to the appropriate fields under the Mapped Field tab in the form field editor. For example, the
Contact 2 First Name
field should be mapped toFirst Name
.Navigate to the Attributes tab and copy the value of Field HTML name for all the three fields. You will need these values for future use.
Posting results to another form
Once the two forms are created, you must configure an action on the first form so that the results from the first form can be pushed to the second form.
Access the first form, go to Actions, and select Post results to another form.
Set a name for the form action.
In Post URL, set the URL to post the first form results to the second form.
This value should in the following format:
https://{instancedomain}/form/submit?formId={destinationId} For example, https://instance.campaignstudio.net/form/submit?formId=2
Here,
{instancedomain}
is the custom domain for your instance and{destinationId}
is the ID for your second form that should receive the results from the first form.(Optional) If you or your team members need to be notified in case of any errors with posting form results to a second form, specify all such email addresses in Post failure notification email.
Under (Optional) Override field names for the receiving form, leave all the fields related to Contact 1 blank. For the fields relating to the second contact that you want to push to the second form, use the format
mauticform[fieldalias]
, wherefieldalias
is the value of Field HTML name field under the Attributes tab for the specific field of the first form. In our example,Contact 2 First Name
should have a value ofmauticform[contact_2_first_name]
.Save the action and the form.
Open the form preview page and complete the form. Ensure that the two email addresses are different.
Observe the form results for both forms and the activity histories for both contact records. You should see the results in all the four places.
Creating FormID field
You must create a hidden field called FormID
in the first form. This field
helps establish the connection between the two forms.
To create this field:
Take a note of the form ID for the second form. To find the form ID, go to Components > Forms and locate the destination form. The ID number is in the far right column.
Return to editing the first form and add a new field, using the Hidden field type.
Specify the Label for the field, set Save result to No, and set Default value to the form ID of the second form.
Note
You cannot have space or underscore in the Label. Acquia recommends that you use
FormID
as the label, which automatically generates a usable alias offormid
.Save the field and the form.