Create and Update Related Salesforce Records with SharinPix Forms

Overview

A SharinPix Form can be configured to synchronize Salesforce related (child) records with the parent record linked to the Form Response. In other words, SharinPix Forms can be used to display, create, and update related (child) records.

For example, when a form is launched from an Account, that Account is automatically set as the parent record of the Form Response. By using Repeated Sections, multiple related Contact records can be created or updated directly within the form. When the form is reopened, those Contacts can be retrieved, and their existing field values can be pre-populated in the form for review or updates.

This article consists of:

circle-exclamation

Configuring Form Repeated sections to pull child records

To pull Salesforce related records into a SharinPix Form, the Pull data from a Salesforce record section of the Repeated Section element must be configured.

  1. Object API Name - [Mandatory] The API name of the child object.

  2. Lookup API Name - [Mandatory] The API name of the lookup field on the child object that links to the Form Response parent record.

  3. Lookup value field API Name - [Required only if you want to create child records, not parent to the Form Response] The API name of the field where the Form Response parent record ID is stored. This is used when child records are created for a different object, rather than directly for the Form Response parent record.

For the third option Lookup value field API Name, this option can be used for example: SharinPix Form is launched from an opportunity object; here, the Form Response Parent object is Opportunity. On the opportunity record, you can store a salesforce record Id for any object (a field on the opportunity record with API name MyObjectRecordId__c).

The Lookup value field API Name should be set to MyObjectRecordId__c. Let's say we still want to create Contacts for an Account; then the Account's record ID should be stored in the MyObjectRecordId__c field. This configuration will allow you to create child records for a specific parent object not directly related to the Form Response.

After the setup for retrieving the child records to be filled in the form is completed, the fields to be pulled must be configured. Each question within the repeated section can be used to represent a specific Salesforce field from the child object.

Question - A dropdown of all form questions API names in this specific section

Salesforce Field API Name - The Field API Name of the child object of which to pull the value

Each question in the section will represent one Salesforce field in the child record being pulled. Example if the Form Section contains:

Batch Number:

  • Form Field API Name - batch_number

  • Salesforce Field API Name - Batch_Number__c

Compliance Status:

  • Form Field API Name - compliance_status

  • Salesforce Field API Name - Compliance_Status__c

Emergency Exists Functional:

  • Form Field API Name - emergency_exits_functional

  • Salesforce Field API Name - Emergency_Exits_Functional__c

External Id:

  • Form Field API Name - external_id

  • Salesforce Field API Name - External_Id__c

circle-exclamation
triangle-exclamation

All Inspection child records for the selected Account are pulled by this configuration. For example, if the Account contains 10 related Inspection records, the SharinPix Form is opened with 10 repeated sections, each one representing a single child record.

To synchronize Salesforce records with SharinPix Form repeated sections, the following must be done:

  • A question must be created inside the repeated section to store the record’s external ID (as shown in the previous image above).

  • The Salesforce API name of the external ID field must be specified in the record pull mappings.

In the External field mapping section, the field that represents the external ID (from the mapped fields) must be selected. This is then used to upsert the child records.

Configuring Form Section or Repeated sections to push child records

Once we have configured the form to pull related child records to represent in repeated sections in our form, we need to specify which fields we want to populate in the record. You can follow the documentation for creation of child records from SharinPix Forms.

circle-exclamation

Once the form configuration is complete, each time a Form Response is submitted, it will check the related child Inspection records. For each Inspection record (represented as a section), it will first check whether a corresponding record already exists by comparing the defined External ID field. If no matching record is found, a new Inspection record will be created. If a matching record already exists, the existing Inspection record will be updated with the data from the submitted Form Response.

circle-info

Please note that there is no limitation on the number of child records that can be retrieved in a form. However, retrieving a large number of records may result in the form URL becoming too long. This is not only influenced by the number of records retrieved, but also by the number of Salesforce fields pulled for each record.

Last updated

Was this helpful?