Salesforce Lookup Field PreFill From Another Lookup Field

In this example, we will explain how to update a Salesforce Lookup field using the Salesforce PreFill. We will use one Salesforce Lookup field to update another Salesforce Lookup field based on a common Salesforce field. For example, the Lead and Contact Email field.

Please drag and drop two Salesforce Lookup fields, two Salesforce PreFill fields, a Hidden field, three Text fields and a Phone field.

Rename the Text, Phone and Hidden fields as shown below. We will use this hidden field as a common Salesforce field (Lead and Contact Email).

image

We will use this lookup field to find a Lead record that will trigger the prefill.

Click the pencil icon of the first Lookup field and set Lead as the Object. Then select Display Additional Fields and save the changes.

image

We are adding this Salesforce PreFill field to find the Lead record fields and set the value in the form fields. The hidden field will be pre-filled with the Lead email.

Click the pencil icon of the first PreFill field, set Lead as the Object, and set the Formyoula and Salesforce Parent Fields.

image

Map the Form fields to the object fields. Save the changes.

image

We will use this lookup field to find a Contact record that will trigger the prefill.

Click the pencil icon of the second Lookup field, set Contact as the Object and select Display Additional Fields. Save the changes.

image

We are adding this Salesforce PreFill field to find the Contact email field and set the value.

Click the pencil icon of the second PreFill field, set Contact as the Object, and set the Formyoula and Salesforce Parent Fields as Lead Email and Email, respectively.

image

Map the Form field to the object field. Save the changes.

image
image

Try the form. We used the Lead Lookup field to update the Contact Lookup field based on the Hidden field (Lead Email).

This is an example template:

Example Form.json10.2KB

For any questions, please contact us - [email protected] or the Formyoula in-app chat 🙂