In this guide, we will explain how we can use Salesforce Lookup to search based on multiple text fields of an object in Salesforce.
Use Case: We want to search for records in Salesforce Lookup by using multiple fields.
Let's consider we have a lookup in our form with object Pricebook entry as shown in the screenshot below.
Now we have some custom fields in our Salesforce and we want to search records based on those fields in the Salesforce lookup.
For example code_product__c, description_product__c, product_country__c
as shown in screenshot below.
Now if we will simply search in lookup based on these fields it will not show any results as shown in the screenshot below
For that, to work we need to edit the JSON of the form.
For JSON editing what you have to do is go to the form editing and add JSON to the link for example if this is your form template link:
https://app.formyoula.com/templates/5fcdaee4bda2d8001ff5cffd/editÂ
Then just edit it and add JSON to it as shown below:
https://app.formyoula.com/json/templates/5fcdaee4bda2d8001ff5cffd/edit
Add the following attribute to the lookup edit the fields based on the requirement we are using code_product__c, description_product__c, product_country__c
since we have these fields in Salesforce and we want to search records using these fields.
"soql_search_field_api_name": "Code_product__c,description_product__c,product_country__c"
As shown in the screenshot below.
After that save the form and try the form and search the records based on these custom text fields.
Below are a few screenshots of results that are displayed based on searching records using code_product__c, description_product__c, product_country__c
custom fields.
These are the records in Salesforce with these custom fields.
For any questions, please contact us - [email protected] or the Formyoula in-app chat 🙂