Skip to content

Use Repeat Groups to Create Salesforce Child and Related Records on Your Mobile Forms

Repeat groups can help you with child or related record creation on Salesforce. You can create any number of Contacts, Opportunities, Products or any other standard or custom object records.

In the following example we will be using a mobile form to create an Account record and multiple Contact records that will be linked with the newly created Account record.



To start go to you Formyoula Dashboard - https://app.formyoula.com/dashboard and click "New Form".



Rename your form, we will use "Account with Contacts".



Add at least one page to your form. We will add one called "Details" and click the "+" button to create it.

Drag and drop a text field on your form. This will be used for the new Account name.You can click the pencil icon to rename the field and make it required.

Next we will add a Repeat Group element that will allow us to create any number of Contacts. 


Click on the Repeat Group pencil icon to edit the Repeat Group label.



Change the label to Contact, this will be used when adding new items to the Repeat Group, for example "Add Contact". 



Drag and drop on the repeat group two text and one email fields for the new Contact. Click the pencil icons to rename the fields. We will use "First Name", "Last Name" and "Email" to populate our Contact record on Salesforce.


When finished, click the "Save & Close" button.



Now we will need to add two Salesforce connections, one for the new Account record and the other one for our Contact records. Click "Add" under the connection column



Select Salesforce from the available connections list and click "Create Connection".



First we will create an Account connection to create our Account record when a form entry is captured. Select Account from the "Salesforce Object" list and click "Save".



So that we can use the newly created Account record for our Contacts, the Account connection "Insert Sequence" will need to be 1. This will insure that the Account is created prior to the Contacts and we will be able to use the AccountId for the new Contact records. Click "Save" when done.




Now we need to map our Formyoula "Account Name" field to the Salesforce Account Name field. When both are selected click "Create Map".



This will create a new mapping for our Account connection. Each time a new entry is captured, the Formyoula Account Name field will be used to create a new Account record in Salesforce. You can create as many fields as you need on your Formyoula forms and map them to your standard and custom object fields.


When the Account connection is setup click "Back to Connections", so that we can create a connection for our Contacts.


Select Salesforce from the available connections list and click "Create Connection".



We will use this connection to create our Contact records from the Contact Repeat Group. Select "Contact" from the "Select Object" list and click "Save".



First, update the "Insert Sequence" to 2, so that the Contact records are created after the Account record is created. This will enable us to use the AccountId, so that the new Contacts can be associated to the new Account record on Salesforce.



As we are using a Repeat Group on our Formyoula form we will need to indicate this under the Contact connection. In the "Use Repeat Group" list select "Contact", this is the Repeat Group we created earlier on the Formyoula form builder.



Next we will need to map our Formyoula fields to the new Salesforce Contact fields. To make sure the new Contact records are associated to the new Account record on Salesforce we will need to map the Account connection as seen below "[New Account (Seq. 1)]" to the "Account Id" field. This will ensure that when new Contact records are created on Salesforce the previously created Account record Id will be used for the new Contact records.



Map all of the other Formyoula form fields to the Salesforce Contact fields. And go back to the Formyoula Dashboard when done.



On the Formyoula Dashboard, click the "Try" button to launch the Mobile Web App. 



Select the newly created form.



Fill in the form and create as many Contacts as you need by clicking "Add Contact" and then "Add" to create a new entry.



Submit the form when it is completed.



Now when you open Salesforce you will be able to see the new Account with the new Contacts that were created on the Formyoula form.



if you have any questions, please email Support@Formyoula.com

Feedback and Knowledge Base