Creating and Updating Salesforce Records with Mogli Form Templates
This guide explains how to configure your Mogli Form Templates to automatically create or update records within your Salesforce organization based on the responses you receive.
Configuration Steps
1. Specify the Target Salesforce Object (Mapped Object Field)
In your Form Template record, locate the Mapped Object field. Enter the API name of the Salesforce object (e.g., Lead, Contact, Account, or a custom object like Event__c) where you want to create or update records. The API name is the unique identifier used by Salesforce (e.g., Contact, Account, Email__c). You can typically find the API name in Salesforce Setup under Object Manager.
Example: To create or update Contact records, you would enter
Contactin the Mapped Object field of your Form Template.
.png)
2. Link Questions to Salesforce Object Fields (Mapped Field)
For each question in your Form Template, you'll need to specify which field on the target Salesforce object should be updated with the recipient's answer. In the corresponding Question Template record, locate the Mapped Field field and enter the API name of the specific field on the Mapped Object that this question's response should update. You can find the API name of fields within Salesforce Setup by navigating to the Object Manager, selecting your object, and then looking at the Fields & Relationships section.
Example: If a question asks for the contact's email address, and the API name of the Email field on the Contact object is
3. Ensure Required Salesforce Fields are Answered
When creating or updating records from a Form Template, Mogli will wait until all Question Templates where the Required field is set to TRUE are answered before attempting to create or update the record in Salesforce. Therefore, ensure that any fields that are mandatory for creating a new record in your Salesforce instance (as defined in your Salesforce object settings, e.g., the "Last Name" field on the Contact object) have the Required checkbox selected in their respective Question Templates. This ensures data integrity and successful record creation/update within Salesforce.
4. Configure Fields for Creation Only (Do Not Update Field)
The Do Not Update Field in the Question Template allows you to specify that the response to a particular question should only be used when creating a new Salesforce record and should not overwrite existing data if the form is submitted by a contact whose record already exists in Salesforce.
Example: This is useful for fields like "Lead Source" that you want to capture when a new Lead record is created through the form but don't want to overwrite if the same Lead submits the form again with a potentially different source. If you set Do Not Update Field to
TRUEfor the "Lead Source" question, a subsequent submission from the same Lead will not change their original lead source in Salesforce.
.png)
Important Considerations and Limitations for Salesforce Integration
The Salesforce object specified in the Mapped Object field of the Form Template must be configured within the Mogli Integrated Object Custom Metadata Type in your Salesforce setup. You can access and manage Custom Metadata Types within Salesforce Setup.
If you are upgrading from an older version of Mogli SMS, ensure the new Mapped Object field is visible on your Form Template Lightning Record Page or Page Layout. You may also want to add relevant fields to the Form Template and Question Template List Views for easier management within Salesforce.
If the value of a response does not match the defined Salesforce field validation rules for the Mapped Field (e.g., incorrect email format, exceeding character limits), the Form will proceed to the next question; therefore, the invalid response will not be saved to the Mapped Field in Salesforce. For example, if the Mapped Field is an email field and the response is "invalidemail," the email field on the Salesforce record will not be updated.