The DataSource Setup feature allows you to connect and manage various data sources. This functionality enables seamless integration of internal and external data, allowing real-time data retrieval. Additionally, users can monitor the connection status of the DataSource and make adjustments as needed to maintain optimal performance.
1. In the top-right corner of the List Builder, click the DataSource Setup button to access the DataSource settings screen.
2. Add a DataSource configuration in either the Basic or Advanced tab:
: For using internal data.
: For integrating external data or complex logic.
3. Once the setup is complete, click the Lists Setup button in the top-right corner to return to the List Builder.
The Basic DataSource enables the integration of data from related objects within Salesforce to be displayed in a single List. By using a Basic DataSource, users can merge data across related objects, ensuring a comprehensive view of information. The real-time data integration ensures that any updates to the connected objects are automatically reflected, providing users with the most up-to-date data. This feature supports more holistic data views, enabling more informed decision-making.
For example, if the object configured in the List Configurator is Product2, and you want to display the price from the related PricebookEntry object, the Basic DataSource can be used to query matching PricebookEntry records and display the product and price together in the List.
1. Click the ➕ button to add a new DataSource.
2. Search for and select the target object for the DataSource.
3. Configure the DataSource by enabling activation, adding a description, setting conditions for querying the target object, and mapping fields to integrate the DataSource data into the List.
1
Active
Activates the DataSource. If not activated, the DataSource will not function during List configuration.
2
Description
Provides a description of the DataSource for clarity.
3

To integrate information retrieved from a DataSource into a List, field mapping actions are performed. This process ensures accurate data merging by setting a common field as a Key between the DataSource and List records. Through this mapping, data from various sources can be effectively consolidated and managed.
1. In the Actions section, click the edit icon in the Key row.
2. Select the DataSource field and the List field with common values, then click the Save button.
3. Verify that the configured Key is applied correctly, then click the Add Action button.
4. Select the DataSource field from which data will be retrieved and choose the List field or virtual field where the data will be saved, then click the Save button.
You want to display the price from the PricebookEntry object alongside a product list configured with Product2 in the List.
Search for and select PricebookEntry in the DataSource.
(Optional) In the Condition field, enter IsActive = true (similar to an SOQL WHERE clause).
To merge data for the matching PricebookEntry record:
Click the edit button in the
In the popup, configure the following, then save:
DataSource Field: Product2Id
List Field: Id
To display the UnitPrice from PricebookEntry in the List:
Create a virtual column (e.g., SBLS_Virtual1) in the Datatable Setup.
Click the Add Action button.
In the popup, configure the following, then save:
DataSource Field: UnitPrice
Virtual Column: SBLS_Virtual1




Conditions
Specifies conditions for querying the target object.
Use the Query Wizard to write conditions easily.
⚠️ When using fields from the List’s configured object, use IN instead of =.
$Current refers to the List’s configured object.
🆗 Product2Id IN {$Current.Id}
❌ Product2Id = {$Current.Id}
4
Performs field mapping to integrate the information retrieved by the DataSource into the List.
✔️
The Advanced DataSource allows you to retrieve and display data from external servers alongside Salesforce data. By leveraging custom Apex Classes or Flows to fetch data, this feature offers greater flexibility and diverse data access compared to internal DataSources. It enables the integration of Salesforce data with external systems, providing a unified view in the List while supporting complex business logic and data transformations.
For instance, if you want to display real-time inventory data from an external server, you can write a REST API call in an Apex Class and specify it as the Advanced DataSource, enabling the data to be displayed in the List.
What is Key?
A Key is a common field used to merge data from the DataSource into the List. It ensures proper integration by linking data from the external DataSource with the List records.
Click the ➕ button to add a DataSource.
Search for and select the target Apex Class.
Configure the following attributes:
1
Active
Enable the DataSource. If not activated, it will not function during List configuration.
2
Description
Add a description for the DataSource.
3
Click the ➕ button to add a DataSource.
Search for and select the target Flow.
Configure the following attributes:
1
Active
Enable the DataSource. If not activated, it will not function during List configuration.
2
Description
Add a description for the DataSource.
3

Key Field
Select a field in the List’s object that shares a common value with the key set in the Apex Class.
✔️
4
Parameters
If the Apex Class requires field values from the List’s object, select and map those fields to be passed as parameters to the Apex Class.
✔️
Input Variable
Select variables to pass data to the Flow. This step is optional if no parameters are needed. 💡 The options displayed are the input variables (marked as “Available for input”) defined in the Flow.
✔️
4
Output Variable
Select variables to retrieve data from the Flow’s result. 💡 The options displayed are the output variables (marked as “Available for output”) defined in the Flow.
✔️
5
Key Field
Select a field in the List’s object that shares a common value with the output variable’s field in the Flow.
✔️


To use an Apex Class for the advanced DataSource setup, you must implement the SBLS.DataSourceService.Fetchable interface. This interface requires the implementation of the execute method, where you define the logic for processing data. The processed data, along with mapping information to the List, must be returned as an instance of the SBLS.DataSourceService.Result object.
This example demonstrates retrieving inventory quantities from an external API based on product codes and mapping them to a virtual column (SBLS_Virtual1) in the List.
Since the SBLS.DataSourceService.Fetchable interface is provided by the package, both the Apex Class and its methods must be declared as global to ensure external access.
This class provides access to the List’s records and fields selected during the builder configuration.
List<SObject> gets()
Returns the records retrieved from the List. If no parameters are added during the builder setup, this will return an empty value.
The Result class holds all mapping information between the DataSource and the List. Actions added to this object define how the data is integrated.
addAction(SBLS.DataSourceService.Action action)
Adds an Action object containing mapping details to the Result.
The Action class stores mapping information between the DataSource and the List.
setKeyValue(Object keyValue)
Sets the Key value from the DataSource that corresponds to the List’s Key.
putSourceToTargetField(Object sourceValue, String targetFieldApiName)
Maps the DataSource value to a field or virtual column in the List.


Simulate fetching data from an external API to retrieve inventory information.
In the example, inventory data is mapped using ProductCode as the key.
Create an instance of SBLS.DataSourceService.Action for each mapping.
Set the DataSource value to the corresponding List field or virtual column using putSourceToTargetField.
Add each action to the .
action
An instance of the SBLS.DataSourceService.Action class that contains the mapping information between the List and the DataSource values.
keyValue
Object
The Key value from the DataSource for mapping.
sourceValue
Object
The value retrieved from the DataSource.
targetFieldApiName
String
The API name of the List’s field or virtual column.


global class DataSourceInventory implements SBLS.DataSourceService.Fetchable {
global SBLS.DataSourceService.Result execute(SBLS.DataSourceService.Parameter params) {
// Retrieve records from the List
List<SObject> records = params.gets();
// Fetch DataSource values (e.g., inventory data) from an external API
Map<String, Integer> inventoryData = new Map<String, Integer>();
inventoryData.put('Product001', 10);
inventoryData.put('Product002', 20);
// Create the Result object
SBLS.DataSourceService.Result result = new SBLS.DataSourceService.Result();
// Map DataSource values to List records
for (String productCode : inventoryData.keySet()) {
SBLS.DataSourceService.Action action = new SBLS.DataSourceService.Action();
action.setKeyValue(productCode); // Set the Key value for mapping
action.putSourceToTargetField(
inventoryData.get(productCode), // DataSource value: inventory
'SBLS_Virtual1' // Virtual column API name
);
result.addAction(action); // Add Action to the Result
}
return result; // Return the final Result
}
}global SBLS.DataSourceService.Result execute(SBLS.DataSourceService.Parameter params) {
List<SObject> records = params.gets();
...
}...
SBLS.DataSourceService.Result result = new SBLS.DataSourceService.Result();
for (String productCode : inventoryData.keySet()) {
// Create an Action object to store mapping information
SBLS.DataSourceService.Action action = new SBLS.DataSourceService.Action();
action.setKeyValue(productCode); // Set the Key value for mapping
action.putSourceToTargetField(
inventoryData.get(productCode), // DataSource value: inventory quantity
'SBLS_Virtual1' // Target field: virtual column in the List
);
result.addAction(action); // Add Action to the Result
}
return result;SBLS.DataSourceService.Result result = new SBLS.DataSourceService.Result();
// Process each product code and inventory information from the DataSource
for (String productCode : inventoryData.keySet()) {
SBLS.DataSourceService.Action action = new SBLS.DataSourceService.Action();
// Set the product code as the Key value to map with the List/Line Item
action.setKeyValue(productCode);
// Map inventory information to the Inventory__c field in the List/Line Item
action.putSourceToTargetField(
inventoryData.get(productCode), // DataSource value: inventory
'SBLS_Virtual1' // Virtual column API name
);
result.addAction(action); // Add mapping information
}
return result; // Return the final result<String, Integer> inventoryData = new Map<String, Integer>();
inventoryData.put('Product001', 10);
inventoryData.put('Product002', 20);// Create the Result object
SBLS.DataSourceService.Result result = new SBLS.DataSourceService.Result();
// Map DataSource values to List records
for (String productCode : inventoryData.keySet()) {
SBLS.DataSourceService.Action action = new SBLS.DataSourceService.Action();
action.setKeyValue(productCode); // Set the Key value for mapping
action.putSourceToTargetField(
inventoryData.get(productCode), // DataSource value: inventory
'SBLS_Virtual1' // Virtual column API name
);
result.addAction(action); // Add Action to the Result
}







