# Advanced DataSource

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

<figure><img src="/files/d1KhocQP3kjHxthWqZfj" alt=""><figcaption></figcaption></figure>

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.

{% hint style="info" %}
Multiple DataSources can be configured and used simultaneously.
{% endhint %}

{% hint style="info" %}
**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.
{% endhint %}

{% hint style="info" %}
**Apex Class Advanced DataSource Setup**

**To configure an Advanced DataSource with an Apex Class,** **you must first create the Apex Class.** Implement the **SBLD.DataSourceService.Fetchable** interface provided by the SmallBuilder Lists package in the Apex Class you want to use.

Learn more about writing Apex Classes >
{% endhint %}

***

### :small\_orange\_diamond: Steps to Configure Apex Class Advanced DataSource

1. Click the :heavy\_plus\_sign: button to add a DataSource.\\

   <figure><img src="/files/Au6YxcMmDZvBZfounSYX" alt=""><figcaption><p>Advanced DataSource Setup</p></figcaption></figure>
2. Search for and select the target **Apex Class**.\\

   <figure><img src="/files/Gkpt9fNUJmWYRwOwHick" alt=""><figcaption><p>Search Apex Class</p></figcaption></figure>
3. Configure the following attributes:\\

   <figure><img src="/files/WnbInVRvXa4uwXOD3A5C" alt=""><figcaption><p>Advanced DataSource for Apex Class Setup</p></figcaption></figure>

<table><thead><tr><th width="84">No.</th><th width="137">Name</th><th width="413">Description</th><th>Required</th></tr></thead><tbody><tr><td>1</td><td><strong>Active</strong></td><td>Enable the DataSource. If not activated, it will not function during List configuration.</td><td></td></tr><tr><td>2</td><td><strong>Description</strong></td><td>Add a description for the DataSource.</td><td></td></tr><tr><td>3</td><td><strong>Key Field</strong></td><td>Select a field in the List’s object that shares a common value with the key set in the Apex Class.</td><td><mark style="color:red;">✔️</mark></td></tr><tr><td>4</td><td><strong>Parameters</strong></td><td>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.</td><td><mark style="color:red;">✔️</mark></td></tr></tbody></table>

***

### :small\_orange\_diamond: Steps to Configure Flow Advanced DataSource

1. Click the :heavy\_plus\_sign: button to add a DataSource.\\

   <figure><img src="/files/Au6YxcMmDZvBZfounSYX" alt=""><figcaption><p>Advanced DataSource Setup</p></figcaption></figure>
2. Search for and select the target **Flow**.\\

   <figure><img src="/files/nUiVi2Wou2bcTXLP1ZJu" alt=""><figcaption><p>Search Flow</p></figcaption></figure>
3. Configure the following attributes:\\

   <figure><img src="/files/66Qx6lm9JnuvcxVUdw69" alt=""><figcaption><p>Advanced DataSource for Flow Setup</p></figcaption></figure>

<table><thead><tr><th width="92">No.</th><th width="163">Name</th><th width="385">Description</th><th>Required</th></tr></thead><tbody><tr><td>1</td><td><strong>Active</strong></td><td>Enable the DataSource. If not activated, it will not function during List configuration.</td><td></td></tr><tr><td>2</td><td><strong>Description</strong></td><td>Add a description for the DataSource.</td><td></td></tr><tr><td>3</td><td><strong>Input Variable</strong></td><td>Select variables to pass data to the Flow. This step is optional if no parameters are needed.<br><br>💡 The options displayed are the input variables (marked as “Available for input”) defined in the Flow.<br><img src="/files/keUSl5nKubbz1pP25Ogf" alt=""></td><td><mark style="color:red;">✔️</mark></td></tr><tr><td>4</td><td><strong>Output Variable</strong></td><td>Select variables to retrieve data from the Flow’s result.<br><br>💡 The options displayed are the output variables (marked as “Available for output”) defined in the Flow.<br><img src="/files/kN7muuWhPYUOh8fim8ZK" alt=""></td><td><mark style="color:red;">✔️</mark></td></tr><tr><td>5</td><td><strong>Key Field</strong></td><td>Select a field in the List’s object that shares a common value with the output variable’s field in the Flow.</td><td><mark style="color:red;">✔️</mark></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.smallbuilder.com/smallbuilder-lists/builder-setup-steps/datasource-setup/advanced-datasource.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
