In this guide, we will explain how to use a Salesforce Prefill with an aggregate COUNT(Id)
query to display the number of Contacts related to a selected Account in a Formyoula form.
1. Initial setup:
- Drag and drop a “Salesforce Lookup”, a “Salesforce Prefill” and a “Number” field onto your form.
- Rename the fields as needed.
- Configuring The “Salesforce Lookup” Field:
- Click the pencil icon of the “Salesforce Lookup” field.
- Set “Object” and “Display Additional Fields” as shown below.
- Configuring The “Salesforce Prefill” Field:
- Click the pencil icon of the “Salesforce Prefill” field.
- Set “Object”.
- Set “Formyoula Parent Field” and “Salesforce Parent Field” as shown below.
- Set the Number (Count Of Total Contact) file under the “Form Field” option.
- Add
COUNT(Id)
under the “Object Field” option.
- Note: Click "Switch to Text" to enter a query for this option.
- Additionally, you can also refer to this guide for a detailed explanation of Salesforce Prefill functionality.- https://guides.formyoula.com/public-guides/salesforce-prefill-field
- Test Your Form:
- Search for an account using the Lookup field.
- The total number of contacts linked to that account will be displayed.
For any questions, please contact us - [email protected] or the Formyoula in-app chat. 🙂