Skip to content

Salesforce Select Child Record Filter

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 Dashbaord.



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 - support@formyoula.com.



Feedback and Knowledge Base