top of page
OmniStudioFactBg.png
Writer's pictureArpitha Devaraja

Using SOQL query in FlexCard’s datasource

Updated: Apr 19, 2023

The data source of a FlexCard is an essential part of the component's functionality, as it determines what data is displayed and how it is presented to the user.

The data source of a FlexCard can be any type of data, including static or dynamic data. Static data can be hardcoded into the component using the ‘Custom’ datasource type, while dynamic data is retrieved from a server or external data source type.


SOQL query is one of the dynamic data retrieved from the database of the salesforce org. Its values are used in the FlexCard in various ways like to add conditions on the particular component of the FlexCard or to send as input to another datasource or another OmniStudio component.

Let us take an example of using SOQL query as datasource type in Flexcard:

  1. Create a FlexCard to use SOQL query as its datasource type.

Under Setup,>> Data Source, use SOQL Query as Data Source Type and add the SOQL query as per the requirement.


Based on the requirement we can either directly call the SOQL query or send value from the FlexCard.


In the below example, we have written a simple query to fetch the fields related to the account and send the recordId as a value from the FlexCard. The output of this query is used in the FlexCard for various purposes.


For testing the output of the SOQL query we can hardcode the recordId value on the Test Parameters section and click on Save & Fetch to get the output details.





The above output will be present in the Flexcard’s DataJson and can be used in the FlexCard components.



In the above screenshot, we can see the values which are fetched from the query can be used as input to open another FlexCard added under ACTION PROPERTIES.


NOTE: In FlexCard’s DataSource Type as SOQL query we cannot use the relationship query, only direct nodes will work else we need to go for another approach like DataRaptor Extract.



2,218 views0 comments

Recent Posts

See All

OmniscriptBaseMixin Methods

Enable a custom Lightning web component to interact with OmniScript by extending the OmniScriptBaseMixin component. The...

Email Action in Omniscript

Email Action The Lightning Email Action allows emails to be sent from anywhere in Salesforce. It will enable greater customization, such...

Comments


bottom of page