In this guide, we will demonstrate how you can create a related record select list. For example, you can create a list of Contacts, Opportunities or Cases related to an account on Salesforce.
We will use the filter option on the Salesforce Select List element to display only the Contacts that are related to a specific Account record that will be found via the Salesforce Lookup element.
Please note that the child record filter will work only in online mode as the information is pulled back directly from Salesforce in real-time.
1. Go to Formyoula.com and click âSign Inâ.
2. Click âNew Formâ.
3. Click âRenameâ to give your new form a name.
4. Â Forms can have multiple pages. We will leave one with the standard name âDetailsâ.
5. Drag and drop the fields on your form. First, we will add a Salesforce Lookup element. This will be used to find an Account record.
6. Click on the âpencilâ icon to edit the field. Select the âAccountâ from the âObjectâ drop-down list. This will allow you to search for Account records on Salesforce when using the Lookup element. Rename the label as needed. Apply the changes when done.
7. Next, drag and drop a Salesforce Select element on your form.
8. Click on the âpencilâ icon to edit the field. Select the âContactâ from the âObjectâ drop-down list. This will allow you to list Contact records from Salesforce when using the Select element. Rename the label as needed. Apply the changes when done.
9. Drag and drop any other fields you need for your particular use case.
10. Click âSave & Closeâ to save your form.
11. Next, we will need to get the Formyoula Salesforce Lookup field ID to use it in the Select element filter. Select the âPDF Editorâ from the âActionsâ drop-down list on your Dashboard.
12. Select the Lookup field. In this case, the field is named âFind Accountâ and copy the ID.
13. Next go back to the dashboard and click on your form name to return to the form builder.
14. Click on the pencil icon on the Salesforce Select element and insert this syntax in the âRecord Filterâ: AccountId = '{{Merged Lookup Field}}', in this case: AccountId = '{{570f-ba80-3af3}}'. Apply the changes when done.
15. Click âSave & Closeâ to save your form.
16. Click on the âTryâ button next to the form. This will open the mobile web app.
17. Select the newly created form.
18. Use the Lookup element to find an Account record in Salesforce.
19. Next click on the Select element and it will display a drop-down list with all Contact records that are related to the Account record you selected via the Lookup element.
20. Submit the form when finished.
[Optional] You can use the JavaScript element to refresh the Salesforce Select Child Record if you change the record on the Salesforce Lookup field.
1. Please drag and drop the JavaScript element.
2. Please edit the field and add the following code:
window.formyoula.form_fields['Find Account Record'].on('change:value', function(){
window.formyoula.form_fields['Find Contact Record'].set( { value: '', name: '' } );
});
Please change the âFind Account Recordâ and âFind Contact Recordâ values to your Salesforce Lookup and/or Select field labels.
For any questions, please contact us - [email protected].