Boost recurring donations this giving season with the new upsell prompt!Learn How >>

Enabling repeating forms on a Forms app page to create multiple Salesforce records with one submission

updated

With the Forms app, you are able to create multiple Salesforce records with a single Forms page submission by a visitor by enabling a repeating form. All records for this submission will be created within the same Salesforce object.

For instance, you might want to allow a logged in user to create one or more family members as Contacts in their household through single form submission. To accomplish this, you could create a Form that includes the Account Id of the logged in user as the Default Value for the hidden Account field on the Form and enable the form to repeat so the logged in user could add as many Contacts as they wished.

This feature can also be used in conjunction with the Directories app to create powerful and flexible shopping cart experiences.

To enable a repeating form:

  • Open the Forms page for which you wish to enable repeating forms
  • Click the Options tab
  • Go to the Repeating Form section
  • For Repeatable Form, choose Yes or No
  • For Repeating Form Session Variable, if enabling a shopping cart experience with the Directories app, enter a string you wish to use as the session array variable. This same string will be added to the Directory you are using in conjunction with the Forms app.
  • For Repeating Form Heading, enter a string you wish to appear at the top of each repeating form. This can include:

         a) Literal text: "Family Member"
         b) {n} variable to designate the number of the form in the repeating series: "Family Member #{n}" which would render as "Family Member #1", "Family Member #2", "Family Member #3"... on the Forms app page.
         c) If enabling a shopping cart experience with the Directories app, a Salesforce field in the format of {$ObjectName.FieldName} that will render the value of a field for the record Id in the session array variable. For instance, if the Directories app displays Opportunity records and the session array variable contains record Ids for Opportunities selected by the visitor, "{$Opportunity.Name}" will display the name of each Opportunity in the repeating form.

    The Repeating Form Heading is optional.
  • For Minimum Number of Repeating Forms, enter the minimum number of forms to be displayed. This is typically 1. If enabling a shopping cart experience with the Directories app, set this to 0.
  • For Maximum Number of Repeating Forms, enter a value if you wish to limit the visitor to creating a certain number of records. Entering no value allow an unlimited number of repeating forms. If enabling a shopping cart experience with the Directories app, leave this blank.
  • For Show Repeat Button, choose Yes or No to show or hide the button that allows the visitor to add an additional form to the page. If enabling a shopping cart experience with the Directories app, set this to No. Otherwise, leave it as Yes.
  • For Repeat Button Text, customize the text of the repeat button
  • For Remove Button Text, customize the text of the remove button
  • For Empty Repeating Form, if enabling a shopping cart experience with the Directories app, customize the text that appears on the Forms app page if nothing has been added to the shopping cart by the visitor

Including a Repeating Section on the Confirmation Page or Admin Email

With the Forms app, you can include variables in the confirmation page or the admin email that render fields values from the record created by the Forms app in Salesforce. With repeating forms enabled, you include a repeating section of the confirmation page or admin email to show values for all records created using the following code:

[repeatableformsection][/repeatableformsection]

Placing this code around the section you wish to repeat will cause the resulting text to iterate through the various records that were created. Using our example above of the logged in user creating family members as Contacts in Salesforce, the following could be used as the confirmation page text where details for each family member would be included in the repeating section:

Thank you for your submission! Here are the family members you added:

[repeatableformsection]
First Name: {$FirstName}
Last Name: {$LastName}
Email: {$Email}
[/repeatableformsection]

We appreciate your support!

 

Have more questions? Submit a request
Article is closed for comments.