Form Features - Default or Prefill Values
Overview
SharinPix Form Elements can be configured to automatically retrieve and display values from related Salesforce records. This prefill functionality allows dynamic population of form fields using data linked to the record from which the form is launched. The configuration is done directly within the SharinPix Form Builder and supports traversing up to five levels of related (lookup) records.
This document covers:
Prerequisite
Before using this feature, ensure:
Ensure that you are using the most recent SharinPix Package Version. Follow this document to upgrade the SharinPix package
Users have the SharinPix Forms permission set assigned.
Getting Started
How to Configure Prefill in a Form Element
To configure prefilling for a question in a SharinPix Form:
- Open the SharinPix Form Builder from the relevant Form Template.
- Select a Question element in the form.
- Navigate to the Advanced tab of the question configuration.
- Enter the appropriate Salesforce Field API Name into the Field API name field.
Prefill Syntax and Examples
The prefill logic uses dot notation to access related Salesforce fields. The general format is:
FieldApiName
LookupApiName.FieldApiName
LookupApiName.LookupApiName.FieldApiName
Note:
SharinPix supports up to 5 levels of nested lookup relationships.
Syntax Components
-
LookupApiName
: The API name of a lookup field on the current object (e.g.,AccountId
on theContact
object). -
FieldApiName
: The API name of the target field from which to pull the value (e.g.,Description
on theAccount
object).
Example
If the form is launched from a Contact record and you want to prefill a field with the related Account’s description, use the following configuration:
AccountId.Description
This will fetch the description value of the account which is related to the contact through to AccountId field.
Advanced Example (Up to 5 Levels)
Example: AssetId.ContactId.ReportsToId.AccountId.CreatedById.Name
This fetches the name of the user who created the Account that is related through a multi-level chain from the current Asset record.
Note:
This is subject to Salesforce’s current maximum of 5 lookup relationship levels per query.
Demo: Pre-Filling Values in a Fire Safety Inspection Form
In this example, you have a Form Template designed for fire safety inspections. The form is launched from a custom Inspection object. Your goal is to dynamically pre-fill:
- The inspection date using a field on the Inspection record itself.
- The address using a field on the related Account record (the parent of the Inspection).
Step 1 : Build a SharinPix Form
If you do not already have a Form Template available, go on SharinPix Form Template and create a new Form Template record. Use the Form Builder to create a SharinPix Form.
Once you have configured your form, you can select the element you want to have a value pre-filled from its parent record or related parent records.
Step 2: Prefill the Inspection Date
Begin by selecting the Date element, which opens the configuration panel to configure pre-fill for it.
To pull the inspection date directly from the Inspection
record:
- Field API Name:
Inspection_Date__c
This retrieves the value from the Inspection_Date__c
field on the record used to launch the form.
Step 3: Prefill the Address from the Account
To pre-fill the address from the related Account record, we use:
Account__c.Address__c
Configuring the pre-fill value to Account__c.Address__c will do the following steps:
- Account__c is the Lookup Field API name on Inspection object. This will look for the parent Account record.
- Address__c is a field in the Account parent record. It will then fetch the Address value of this Account.
0 Comments
Add your comment