You are here:
Set Up a Data Source on a Flexcard
Configure how to retrieve the data that a Flexcard shows. Pull it directly from Salesforce objects with Omnistudio Data Mappers, Salesforce Object Query Language (SOQL) queries, and Salesforce Object Search Language (SOSL) searches. You can also use an external source with REST methods. For complex business processes, use the Apex remote method or Integration Procedures. If needed, set different data sources for the child and parent Flexcards. Then, choose where to publish the Flexcard.
For optimal flexibility and easier implementation, use an Integration Procedure as a data source to execute multiple actions in a single server call. See Set Up an Integration Procedure Data Source.
If you don’t see a data source, confirm that it’s turned on. See Enable and Disable Data Sources.
Set up the data source when you create a Flexcard or update the existing data source on an existing, inactive Flexcard from the Setup tab. See Configure Flexcard Settings.
This article describes the information required after you select the data source type for the Flexcard.
- Set Up a SOQL Query Data Source
Configure a data source to use a Salesforce Object Query Language (SOQL) query to search an org's data for specific information. SOQL queries are encrypted so that Flexcards don’t display query information on the client-side. - Set Up a SOSL Search Data Source
Construct text-based search queries against the search index with Salesforce Object Search Language (SOSL). By using a single query, you can search text, email, and phone fields for multiple objects to which you have access, including custom objects. SOSL queries are encrypted so the query information isn’t visible on the client side. To enforce field-level security for an SOSL query, navigate to Setup and add the EnableQueryWithFLS Omni Interaction Configuration and set it to true: EnableQueryWithFLS=true - Set Up an Apex Remote Data Source
Configure a data source to invoke an Apex class and method that fetch data to populate a Flexcard. Apex remote data sources can run asynchronously, which increases the CPU time but ensures that long-running transactions don’t time out. An Apex remote class is a standard Apex class that implements the VlocityOpenInterface. - Set Up an Apex REST Data Source
Configure a data source to use an Apex REST call to retrieve data to populate fields on a Flexcard with the GET method. Use the POST method to send back data to the server. - Set Up an Omnistudio Data Mapper Data Source
Configure a Data Mapper data source to fetch data from a Data Mapper Extract. Field-level security is fully supported. - Set Up a REST Data Source
Configure a REST data source by retrieving or sending data through a public API, such as weather data from a weather API based on a policyholder's ZIP code. You can also use named credentials to authenticate Apex callouts that specify the URL of a callout endpoint and its required authentication parameters in one definition. - Set Up an Integration Procedure Data Source
Configure a data source to use an Integration Procedure that executes multiple actions in a single server call. For example, you want your customer service agents to view the weather forecast of policyholders when they’re on a call. To do so, use an Integration Procedure with a Data Mapper Extract that returns an account's ZIP code. Then, use a REST API call that gets the current forecast for the account's region based on the ZIP code. - Set Up a Streaming API Data Source
The streaming API method uses push technology, which is a publish and subscribe model that transfers information initiated from a server to the client based on criteria that you define. It has a persistent connection that continuously delivers new data as it becomes available, rather than using client polling. By using streaming API, you reduce the number of API calls and thus improve performance. - Set Up a Custom Data Source
Directly embed custom JSON data into Flexcard without depending on an external data source. Configure this custom data to test with temporary static data, such as when waiting for API access or for rapid concept testing. - Set Up an Autolaunched Flow Data Source (Pilot)
Configure a data source to use a new or existing autolaunched flow in your Flexcard.
Set Up a SOQL Query Data Source
Configure a data source to use a Salesforce Object Query Language (SOQL) query to search an org's data for specific information. SOQL queries are encrypted so that Flexcards don’t display query information on the client-side.
When you map fields, only fields in the field picker that have non-null values for the specific record in the test query are visible. Use a test record that you know has non-null values for all the fields to map. Or use custom fields if the test record doesn't have such fields.
-
To enforce field-level security for an SOQL query:
- From Setup, select and open Omni Interaction Configuration.
- Click New Omni Interaction Configuration.
- For Name and Label, enter EnableQueryWithFLS. For Value, enter true.
- Save your changes.
When the EnableQueryWithFLS setting is enabled, Flexcards display only the fields that the user has permission to view. Any fields the user doesn't have access to are hidden.
Important During the week of February 2, 2026, Salesforce enables the EnableQueryWithFLS setting by default to enhance org security. Review and prepare your configuration for a seamless transition and to prevent potential service interruptions. See Security Checks for Omnistudio. -
Enter an SOQL query and other options as needed.
For example, get up to 10 fields from the Contact object when there’s an existing email address by using this query:
SELECT Id, Name, Email, Phone, Title FROM Contact WHERE Email != Null LIMIT 10
Set Up a SOSL Search Data Source
Construct text-based search queries against the search index with Salesforce Object Search Language (SOSL). By using a single query, you can search text, email, and phone fields for multiple objects to which you have access, including custom objects. SOSL queries are encrypted so the query information isn’t visible on the client side. To enforce field-level security for an SOSL query, navigate to Setup and add the EnableQueryWithFLS Omni Interaction Configuration and set it to true: EnableQueryWithFLS=true
- Enter the search term.
- Select the fields to search from.
- Select at least one sObject and one field to search.
- If needed, enter a limit of the maximum number of rows to return.
- Enter other search information as needed.
Set Up an Apex Remote Data Source
Configure a data source to invoke an Apex class and method that fetch data to populate a Flexcard. Apex remote data sources can run asynchronously, which increases the CPU time but ensures that long-running transactions don’t time out. An Apex remote class is a standard Apex class that implements the VlocityOpenInterface.
Before you begin, add an Apex class permissions checker to define who can access VlocityOpenInterface classes (APIs) from a remote action on a Flexcard. See Set Up Access to Remote Action APIs.
-
Select an Apex class and method.
See View Apex Classes.This example shows an Apex class
RemoteActionClasswith agetAccountsmethod:global class RemoteActionClass implements [Namespace].VlocityOpenInterface2 { public Boolean invokeMethod(String methodName, Map<String,Object> input, Map<String,Object> outMap, Map<String,Object> options) { if (methodName.equals('getAccounts')) { getAccounts(input, outMap, options); } return true; } public void getAccounts(Map<String,Object> input, Map<String,Object> outMap, Map<String,Object> options) { String accountName = String.valueOf(input.get('account')); List<Account> accounts = new List<Account>(); if (String.isBlank(accountName)) { accounts = [SELECT Id, Name, Phone FROM Account]; } else { accounts = [SELECT Id, Name, Phone FROM Account WHERE Name Like :('%' + accountName + '%')]; } outMap.put('accounts', accounts); } } - Choose whether to run the call asynchronously through Apex.
- If needed, enter an interval in milliseconds to check the response status.
-
If needed, pass values from the Flexcard to the remote class method:
- Add an input map.
- In Key, enter a context ID variable.
- In Value, enter the variable value.
For example, enter the AccountId key and a record’s account ID as the value.
-
If needed, send additional key value pairs to the input map passed to the remote
method:
- Add an options map.
- Enter the values.
- Enter other Apex remote data source information as needed.
Set Up an Apex REST Data Source
Configure a data source to use an Apex REST call to retrieve data to populate fields on a Flexcard with the GET method. Use the POST method to send back data to the server.
For optimal flexibility and easier implementation, use an Integration Procedure as a data source to execute multiple actions in a single-server call. See Set Up an Integration Procedure Data Source.
-
Enter the endpoint URL such as
/services/apexrest/{namespace}/CardTestApexRestResource/{recordId}.
This example shows a REST class:
@RestResource(urlMapping='/v1/typeahead/*') global with sharing class TypeaheadApexRest { @HttpGet global static void doGet() { RestResponse res = RestContext.response; res.responseBody =blob.valueOf('["amazon","airbnb","amazon prime","american airlines","american express","apple","aol mail","at\u0026t","apple store","adele"]'); } @HttpPost global static void doPost() { RestRequest req = RestContext.request; RestResponse res = RestContext.response; res.responseBody = blob.valueOf(JSON.serialize(new Map<String, Object>{'someResponse' => 'Post is done'})); } } -
Select a method type:
- GET: Request data based on the parameters of the URL.
- POST: Send JSON data.
-
For the POST method, enter the JSON data to send in the JSON Payload field.
You can use context variables to pass inherited values with either method.
- Enter other Apex REST data source information as needed.
Set Up an Omnistudio Data Mapper Data Source
Configure a Data Mapper data source to fetch data from a Data Mapper Extract. Field-level security is fully supported.
Before you begin, create a Data Mapper Extract that has an input parameter that corresponds to the Flexcard's context ID, such as AccountId. See Working with Omnistudio Data Mappers.
Set Up a REST Data Source
Configure a REST data source by retrieving or sending data through a public API, such as weather data from a weather API based on a policyholder's ZIP code. You can also use named credentials to authenticate Apex callouts that specify the URL of a callout endpoint and its required authentication parameters in one definition.
Before you begin:
- Register the REST endpoint URL in Remote Sites. See Configure Remote Site Settings.
- Add the REST endpoint URL as a trusted URL. See Manage Trusted URLs.
-
Select the REST type and then the method type:
- GET: Request data based on the parameters of the URL.
- POST: Send JSON data.
-
For the named credential REST type:
- Select a named credential.
-
Enter a relative path for data retrieval such as
My_Payroll_System/paystubs?format=json.
-
For the Web REST type, enter the REST endpoint URL such as
http://api.weatherstack.com/current?access_key={Session.weatherAPIkey}&query={BillingCity}. -
For the POST method, enter the JSON data to send in the JSON Payload field.
You can use context variables to pass inherited values with either method.
-
If needed, add request headers such as tokens, public keys, or content-type:
- Add a key-value pair.
- In Key, enter a context ID variable.
- In Value, enter the variable value.
- Enter other REST data source information as needed.
Set Up an Integration Procedure Data Source
Configure a data source to use an Integration Procedure that executes multiple actions in a single server call. For example, you want your customer service agents to view the weather forecast of policyholders when they’re on a call. To do so, use an Integration Procedure with a Data Mapper Extract that returns an account's ZIP code. Then, use a REST API call that gets the current forecast for the account's region based on the ZIP code.
Before you begin, create an Integration Procedure. See Omnistudio Integration Procedures.
- Find and select the Integration Procedure to use.
-
If needed, pass values from the Flexcard to the Integration Procedure:
- Add a key-value pair.
- In Key, enter a context ID variable.
-
In Value, enter the variable value in
{}, {}, ...format. Array format isn’t supported.
array if objects in the form of [{},{}] will break interpolation logic, as it only accepts data of format { }, Unable to pass array of objects as input parameters to IP Data Action from a Flexcard to [Doc] Unable to pass array of objects as input parameters to IP Data Action from a Flexcard
For example, enter the AccountId key and a record’s account ID as the value.
-
If you use Omnistudio Winter ‘23 or later, configure your Integration Procedure to
use the Continuation class in Apex to make a long-running request to an external Web
service:
- Add an options map.
- In Key, enter useContinuation.
- In Value, enter true.
See Continuation Class.
- If needed, add sample data to the Integration Procedure.
- Enter other Integration Procedure data source information as needed.
Set Up a Streaming API Data Source
The streaming API method uses push technology, which is a publish and subscribe model that transfers information initiated from a server to the client based on criteria that you define. It has a persistent connection that continuously delivers new data as it becomes available, rather than using client polling. By using streaming API, you reduce the number of API calls and thus improve performance.
Before you begin, create a streaming API data source. See PushTopic Events (Legacy), Generic Events (Legacy), and Push Technology.
The Streaming API data source is only supported with the designer on a managed package.
-
Select the streaming API type:
-
PushTopic: SOQL query that returns a result that notifies listeners of record changes in Salesforce by using a streaming API channel. For example, use this method to get notified when someone creates a case for a type, a status, or both.
-
Streaming Channel: Streaming API that sends notifications of general events that don’t relate to Salesforce data changes. You can use this method for any application that sends custom notifications, such as a chat application.
-
Platform Event: Event-driven messaging architecture that enables apps to communicate inside and outside of Salesforce. A platform event combines the PushTopic and streaming channel types. Instead of working with an sObject, platform events work with custom objects.
-
- In Channel, enter the URL of the streaming API.
- Select the type of operation, whether the retrieved data replaces or adds to the existing data.
-
From the Get All Messages picklist, select one of these options:
- True: Get all data from the last 24 hours.
- False: Get the latest data update.
- Enter other streaming API data source information as needed.
Set Up a Custom Data Source
Directly embed custom JSON data into Flexcard without depending on an external data source. Configure this custom data to test with temporary static data, such as when waiting for API access or for rapid concept testing.
-
Enter your custom JSON code, such as:
[ { "attributes": { "type": "Contact", "url": "/services/data/v49.0/sobjects/Contact/0033700000TOF0eAAH" }, "Name": "Perry", "Id": "0033700000TOF0eAAH", "Phone": "(734) 489-5851", "AccountId": "0013700000NVVLvAAP", "Email": "perry@vlocity.com", "MailingAddress": { "city": "Concord", "country": "US", "geocodeAccuracy": null, "latitude": null, "longitude": null, "postalCode": "53813", "state": "WI", "street": "856 4th Avenue #76" }, "CreatedDate": "2017-06-14T18:53:11.000+0000" }, { "attributes": { "type": "Contact", "url": "/services/data/v49.0/sobjects/Contact/0033700000TOB6mAAH" }, "Name": "Robert0 Taylor", "Id": "0033700000TOB6mAAH", "Phone": "(888) 888-8888", "AccountId": "00137000007D63JAAS", "MailingAddress": { "city": "SF", "country": "US", "geocodeAccuracy": null, "latitude": null, "longitude": null, "postalCode": "99999", "state": "CA", "street": "50 Santa Rita St" }, "CreatedDate": "2017-06-13T21:08:25.000+0000" }, { "attributes": { "type": "Contact", "url": "/services/data/v49.0/sobjects/Contact/0033700000TNvK0AAL" }, "Name": "c1", "Id": "0033700000TNvK0AAL", "AccountId": "0013700000NVE4tAAH", "MailingAddress": null, "CreatedDate": "2017-06-08T20:13:41.000+0000" }, { "attributes": { "type": "Contact", "url": "/services/data/v49.0/sobjects/Contact/0033700000TNvKKAA1" }, "Name": "c2", "Id": "0033700000TNvKKAA1", "AccountId": "0013700000NVE4tAAH", "MailingAddress": null, "CreatedDate": "2017-06-08T20:13:50.000+0000" }, { "attributes": { "type": "Contact", "url": "/services/data/v49.0/sobjects/Contact/0033700000Vs6RzAAJ" }, "Name": "Smith", "Id": "0033700000Vs6RzAAJ", "Phone": "(300) 333-3763", "AccountId": "001370000098i8mAAA", "MailingAddress": { "city": "SF", "country": "US", "geocodeAccuracy": null, "latitude": null, "longitude": null, "postalCode": "99999", "state": "CA", "street": "50 Fremont St" }, "CreatedDate": "2017-08-16T20:26:07.000+0000" } ] - Enter other custom data source information as needed.
Set Up an Autolaunched Flow Data Source (Pilot)
Configure a data source to use a new or existing autolaunched flow in your Flexcard.
Before You Begin
- Contact Agentforce to enable this pilot feature in your org.
- Make sure that you've enabled Enhanced Runtime Performance in Omnistudio Settings. See Enable Enhanced Runtime Performance of Components.
- Make sure you don't use a flow that has the Picklist, Multi-Select Picklist, or Apex-Defined data types.
You can use an autolaunched flow as a data source, or add it via an Action input element.
- In the Flexcard's Setup panel, navigate to the Data Source section.
- In the Data Source Types dropdown, select Autolaunched Flow.
- In the Autolaunched Flows field, search for the flow you want to use as a data source and select it.
- In the Import section, click Import.
- In the resulting window, select the keys you want to include in your inputs and enter their values.
- To add an autolaunched flow as an action, add an Action input element to your designer.
- In the Element Details panel, expand the Action section.
- Select Data as the action type.
- In the Data Source Types dropdown, select Autolaunched Flow.
- In the Input Map section, select Import.
- In the resulting window, select the keys you want to include in your inputs and enter their values.

