Loading
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Set Up a Data Source on a Flexcard

          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.

          Note
          Note We recommend that when you pull data into the Flexcard through any data source, you impose a low limit on the amount of data you're fetching. After your card is developed and published, you can increase the amount of data you pull.
          • 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.

          Note
          Note

          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.

          1. To enforce field-level security for an SOQL query:
            1. From Setup, select and open Omni Interaction Configuration.
            2. Click New Omni Interaction Configuration.
            3. For Name and Label, enter EnableQueryWithFLS. For Value, enter true.
            4. 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
            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.
          2. 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

          Important
          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.
          1. Enter the search term.
          2. Select the fields to search from.
          3. Select at least one sObject and one field to search.
          4. If needed, enter a limit of the maximum number of rows to return.
          5. 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.

          1. Select an Apex class and method.
            This example shows an Apex class RemoteActionClass with a getAccounts method:
            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);
                }
            }
          2. Choose whether to run the call asynchronously through Apex.
          3. If needed, enter an interval in milliseconds to check the response status.
          4. If needed, pass values from the Flexcard to the remote class method:
            1. Add an input map.
            2. In Key, enter a context ID variable.
            3. In Value, enter the variable value.

            For example, enter the AccountId key and a record’s account ID as the value.

          5. If needed, send additional key value pairs to the input map passed to the remote method:
            1. Add an options map.
            2. Enter the values.
              Note
              Note

              The Value fields support static values and merge fields such as {recordId} or {name}.

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

          Note
          Note

          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.

          1. 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'}));
                }
            }
          2. Select a method type:
            • GET: Request data based on the parameters of the URL.
            • POST: Send JSON data.
          3. 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.
          4. 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.

          1. Find and select the Data Mapper to use.
          2. If needed, pass values from the Flexcard to the Data Mapper’s input parameters:
            1. Add an input map.
            2. In Key, enter a context ID variable.
            3. In Value, enter the variable value.

            For example, enter the AccountId key and a record’s account ID as the value.

            Note
            Note

            The Value field supports static values and merge fields such as {recordId} or {name}.

          3. Enter other Data Mapper data source information as needed.

          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:

          1. Select the REST type and then the method type:
            • GET: Request data based on the parameters of the URL.
            • POST: Send JSON data.
          2. For the named credential REST type:
            1. Select a named credential.
            2. Enter a relative path for data retrieval such as My_Payroll_System/paystubs?format=json.
          3. For the Web REST type, enter the REST endpoint URL such as http://api.weatherstack.com/current?access_key={Session.weatherAPIkey}&query={BillingCity}.
          4. 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.

          5. If needed, add request headers such as tokens, public keys, or content-type:
            1. Add a key-value pair.
            2. In Key, enter a context ID variable.
            3. In Value, enter the variable value.
          6. 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.

          1. Find and select the Integration Procedure to use.
          2. If needed, pass values from the Flexcard to the Integration Procedure:
            1. Add a key-value pair.
            2. In Key, enter a context ID variable.
            3. In Value, enter the variable value in {}, {}, ... format. Array format isn’t supported.
            Note
            Note

            The Value fields support static values and merge fields such as {recordId} or {name}.

            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.

          3. 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:
            1. Add an options map.
            2. In Key, enter useContinuation.
            3. In Value, enter true.
          4. If needed, add sample data to the Integration Procedure.
          5. 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.

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

          2. In Channel, enter the URL of the streaming API.
          3. Select the type of operation, whether the retrieved data replaces or adds to the existing data.
          4. 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.
          5. 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.

          1. 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"
            	}
            ]
          2. 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

          Note
          Note Autolaunched flows in Flexcards is a pilot or beta service that is subject to the Beta Services Terms at Agreements - Salesforce.com or a written Unified Pilot Agreement if executed by Customer, and applicable terms in the Product Terms Directory. Use of this pilot or beta service is at the Customer's sole discretion.
          • 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.

          1. In the Flexcard's Setup panel, navigate to the Data Source section.
          2. In the Data Source Types dropdown, select Autolaunched Flow.
          3. In the Autolaunched Flows field, search for the flow you want to use as a data source and select it.
          4. In the Import section, click Import.
          5. In the resulting window, select the keys you want to include in your inputs and enter their values.
          6. To add an autolaunched flow as an action, add an Action input element to your designer.
          7. In the Element Details panel, expand the Action section.
          8. Select Data as the action type.
          9. In the Data Source Types dropdown, select Autolaunched Flow.
          10. In the Input Map section, select Import.
          11. In the resulting window, select the keys you want to include in your inputs and enter their values.
           
          Loading
          Salesforce Help | Article