This guide explains how to build a form that captures family member details using a "Repeat Group" field and automatically creates Salesforce records on submission.
It will create an Account record (using the Last Name of the primary family person), then for each family member entry, including the primary family person, the form creates Salesforce Contact records containing all personal details.
Here, two Salesforce connections work in sequence. The Account is created first, and the Contacts are then linked to it via the new Account ID.
1. INITIAL SETUP:
- Drag and drop a “Hidden” and a "Repeat" field onto your form.
- Rename the fields as needed.
- Drag and drop some fields with a “Field update Workflow” field into the Repeat section (in this case, a "Checkbox", a "Select", two "Text" fields, and a "Number" field) to capture personal information for family members.
- Rename the fields as needed.
2. CONFIGURE THE FIELDS INSIDE THE REPEAT GROUP:
- THE "CHECKBOX" FIELD: This field identifies which family member is the primary contact. This value is also used by Connection 1 (Salesforce Account).
- THE "SELECT" FIELD:
- Click the pencil icon on the "Select" field.
- Set “Select Options” to describe the family relationship.
FatherMotherChild (Son)Child (Daughter)
- CONFIGURE THE "FIELD UPDATE WORKFLOW" FIELD:
- Click the pencil icon of the "Field Update Workflow" field.
- This field monitors the Primary Family Person checkbox and automatically writes the Last Name of the primary entry into the Hidden "Account Name" field outside the Repeat Group.
- Rule Criteria: This defines the condition that triggers the workflow. When the checkbox is ticked (value = 1), the success action runs. When unticked, the fail action runs.
- Set the Rule Criteria:
Primary Family Person || equals || 1 - Field Updates Success: This copies the Last Name of the primary family member into the Hidden "Account Name" field, ready to be used by Connection 1.
- Set Field Updates Success:
Account Name || value || {{9012-8fe4-f2ab}} - Here,
{{9012-8fe4-f2ab}}is the merge field for the Last Name field. - Field Updates Fail: This clears the Hidden field if the checkbox is unticked, ensuring no incorrect value is carried over.
- Set Field Updates Fail:
Account Name || value ||
3. CREATE SALESFORCE CONNECTIONS:
This form uses two Salesforce connections working in sequence:
- Connection 1: Account: This connection creates a single Salesforce Account record using the value stored in the hidden "Account Name" field, which contains the Last Name of the Primary Family Person.
- Connection 2: Contact: Creates a Salesforce Contact record for every repeat entry, including the primary family person. It runs after Connection 1, so it can use the newly created Account ID to link all Contacts to the same Account.
Please check out this step-by-step basic guide on how to set up Salesforce connections for a form: https://guides.formyoula.com/public-guides/connect-your-forms-with-salesforce-objects
- SET UP SALESFORCE ACCOUNT CONNECTION: This connection creates a new Salesforce Account record using the value stored in the hidden "Account Name" field.
- Map the fields as shown below.
Note: This connection runs first. The Account ID it generates is then used by Connection 2 to link the Contact.
- SET UP SALESFORCE CONTACT CONNECTION: This connection creates a new Salesforce Contact record for every repeat entry and links each Contact to the Account created in Connection 1.
- Map the fields as shown below.
- Note:
- The
[New Account Record ID (Seq. 1)]is a dynamic system value, it is not a form field. It references the ID of the Account record that was just created by the first connection in the same submission sequence. This is what links the Contact to the Account. - This connection runs after Connection 1, so that the new Account ID is already available to be mapped to the Contact's
AccountIdfield.
- Set up the record settings:
- Click the “Salesforce Record Settings”.
- Set repeat group under the “Use Repeat Group” option.
- Links this connection to the repeat group, so a separate record is created for each repeat entry.
7. TEST THE FORM:
- Try the form.
- Click “Add Family Member” and add some entries (Fill in family member's details: Relation, First Name, Last Name, and Age)
- Note: Tick the “Primary Family Person” checkbox for one entry (this entry will create an Account in Salesforce).
- Submit the form.
- It will create one Account and three Contacts.
- In Salesforce, verify:
- One Account record was created (using the Last Name of the primary member).
- Contact records were created for all entries, each linked to the Account via the
AccountIdfield. - For the non-primary entry, confirm no Account was created but the Contact was still linked to the Account.
Optional: Please check out the Table view UI for the Repeat group.
For any questions, please contact us - [email protected] or the Formyoula in-app chat 🙂