Lookup Element
Run a query using text input to retrieve Salesforce data using the Lookup element. The retrieved data is returned in Value/Label pairs and becomes available for selection in a dropdown list.
The Lookup element calls the DataRaptor Output service to query SFDC tables based on the parameters configured in the Properties section. To avoid performance issues, it is recommended to keep the number of value results under 150. Select the Custom type to run a custom Apex class. Lookup elements display values from Salesforce based on a standard SOQL query built using the parameters of the Lookup elements.
SObject Type
To query for SObject data:
- Set the Data Source Type to SObject.
- Under Input Parameters, configure these fields:
Data Source: Select an Element Name from the dropdown to send that element's JSON value in the lookup request.
Filter Value: Enter a name for the JSON value to use in the lookup query configuration.
3.Configure the Lookup Query Configuration
4.In the Populate Lookup Element with Query Results section, set a label and a value for the Lookup results by configuring these fields:
Label: Set the label for a Lookup Element's dropdown list to a JSON Value returned by the query. Because the query returns the values in the Lookup Element's JSON Path, you must set the full path. For example, to display an Account Name as a label in a Lookup Element named Company, the full path is Company:Name.
Value: Set the Value to an Object field that populates the Lookup Element's JSON Node using the full path. When a user selects a label, the value populates the Lookup element's JSON Node. For example, to use an Account Id for a JSON value when a user selects an Account Name from the Lookup element, the full path is Company:Id.
5.Preview the OmniScript to ensure the query is working and the value is being set correctly.
Agenda:
SELECT NAME FROM CONTACT WHERE Account.Type='Prospect' AND Account.Rating='Hot'
These are the accounts having Type as Prospect or Rating as Hot
First aim is to get all accounts having Type=Prospect
So,first create an omniscript and then add lookup to the step.
Set the value of Type to Prospect.
We have to use JSON Path ,so that Id will be stored in the backend and name will be shown in the lookup filter.
0 Comments
Your valuable feedback !