# Data Sources

Dynamic Widgets in your interface become truly powerful when paired with data sources that allow you to display live or structured content in a flexible and reusable way. Whether you're showcasing a list of products, pulling data from an API, or working with static sample data, the **Data Sources** feature provides the foundation for creating content-rich, personalized components.

This guide walks you through the three supported data source types:

* **Collection** – product groups created in Omnitron,
* **API** – external or internal endpoints serving JSON data,
* **Static** – manually entered values for simple use cases.

For each type, you’ll learn how to add the data source, connect it to widgets using the **Iterator** component, and bind specific data fields to UI elements like headings, images, or text blocks.

Let’s start with the **Collection** type, ideal for pulling product data directly from your Omnitron catalog.

## <mark style="color:red;">Data Source Collection</mark> <a href="#cycidjiofmai" id="cycidjiofmai"></a>

The **Collection** data source allows you to fetch product data dynamically based on collections created in **Omnitron**. These collections are defined under:

* **Omnitron > Products and Catalogs > Collections**

### <mark style="color:red;">Add a Collection as a Data Source</mark> <a href="#d3u0kfxonsqd" id="d3u0kfxonsqd"></a>

To integrate a collection into your widget, follow these steps:

1\. Navigate to the **left-hand sidebar** and click on the **Data Sources** button.<br>

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

2\. In the opened pop-up, click the **Add New** button.<br>

<figure><img src="/files/18Huv4ets7KlxSXfHJQu" alt=""><figcaption></figcaption></figure>

3\. Select the **Collection** tab from the available data source types.<br>

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

4\. In the **Select Collection** dropdown, choose the desired product collection from the list.<br>

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

5\. In the **Product Limit** field, specify how many products should be fetched and displayed (e.g., 4, 8, 12). The system retrieves the first items in the collection in order—so if you enter "4", it will display the first four products from the collection.<br>

<figure><img src="/files/9o5dQRENTMUCAjuqIqOI" alt=""><figcaption></figcaption></figure>

6\. Click **Add** to save the data source.

Your collection is now ready to be used in any widget that supports data iteration.

### <mark style="color:red;">How to Use a Collection in a Widget?</mark> <a href="#nhf0ovtkqbr3" id="nhf0ovtkqbr3"></a>

To display products from the collection in a widget:

1\. From the **Advanced** tab of the component library, drag and drop an **Iterator** component into your layout.

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

2\. Click the Iterator component and go to the **Properties** area.

3\. In the **Selected Data Source** dropdown, choose the collection data source you previously created.

![](/files/e9R9KH1WCxX2UUvp4qTp)

4\. Now, drag a component such as H1, Image, or Text into the Iterator to display individual product information.

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

5\. Select the inner component (e.g., H1), go to its **Properties** panel, and bind a product field (e.g., name, price, image, etc.) to dynamically display product-specific content.<br>

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

## <mark style="color:red;">Data Source API</mark> <a href="#id-94zzdocic91n" id="id-94zzdocic91n"></a>

The API data source enables your widget to retrieve structured data from external endpoints. This is especially useful when you want to connect widgets with external systems, microservices, or third-party data providers.

### Add an API as a Data Source <a href="#id-1zi1ccf061da" id="id-1zi1ccf061da"></a>

1\. In the **Add Data Source** pop-up, select the **API** tab.

<figure><img src="/files/6ZlPoKXF75N9v7NeHZ4P" alt=""><figcaption></figcaption></figure>

2\. Enter the endpoint URL in the **API URL** field (e.g., <https://api.example.com/products>).

3\. Click **Add** to register the API data source.<br>

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

You can now use the retrieved data across widgets, assuming the API returns JSON-formatted content.

### <mark style="color:red;">How to Use an API Data Source in a Widget?</mark> <a href="#r7tgh7ntpsxy" id="r7tgh7ntpsxy"></a>

1\. Drag and drop the **Iterator** component from the **Advanced** tab into your widget.<br>

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

2\. Click on the Iterator and open the **Properties** panel.

3\. From the **Selected Data Source** dropdown, choose your API-based data source.<br>

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

4\. In the **Data Key** field, enter the JSON key that contains the array of items you want to loop through.

For example, if the API response looks like:

```json
{ "products": [ {...}, {...} ] }
```

then type products as the Data Key.

<figure><img src="/files/2tq9u1pMJLukG7iLtoVC" alt=""><figcaption></figcaption></figure>

5\. Click **Add** to finalize the data binding.

6\. Inside the Iterator, drag components such as **H1** or **Image**.

![](/files/wGzKo3Pucvf3hzN6UfUh)

7\. Select the component and from its **Properties**, choose the corresponding field you want to display (e.g., `title`, `image_url`, etc.).

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

## <mark style="color:red;">Data Source STATIC</mark> <a href="#npmk7dautg33" id="npmk7dautg33"></a>

**STATIC** is used for manually defined, fixed data. It is written in **JSON format** and ideal for scenarios where no API connection is needed.

### <mark style="color:red;">Add a STATIC Data Source</mark> <a href="#id-6di436r1s0pi" id="id-6di436r1s0pi"></a>

1\. In the **Add Data Source** pop-up, select the **Static** tab.

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

2\. Assign a descriptive name to your data source (e.g., staticProducts).

3\. Click **Add New Item** to start defining data entries.<br>

<figure><img src="/files/0XmUoGiFJPrT6fDaT67J" alt=""><figcaption></figcaption></figure>

4\. Under each “Item”, add properties one by one by clicking the **+ Add New Item** button. For example:

* Property Name: `id`\
  Property Value: `1`
* Property Name: `name`\
  Property Value: `Static Product 1`
* Property Name: `price`\
  Property Value: `100`
* Property Name: `image`\
  Property Value: `https://example.com/image1.jpg`

![](/files/2Tpk9P82kLhbpp7SlLMw)

{% hint style="danger" %}
Don’t forget to click **Add Property** button after entering each field.
{% endhint %}

5\. Once all properties are defined, click **Save** to finalize the data entry.

![](/files/QZGFAJ4md6KHF8Pukd49)

### <mark style="color:red;">How to Use Static Data in a Widget?</mark> <a href="#gw7ix2r2z02v" id="gw7ix2r2z02v"></a>

1\. Drag and drop the **Iterator** component from the **Advanced** tab into your layout.<br>

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

2\. Click the Iterator and open its **Properties** panel.

3\. From the **Selected Data Source** dropdown, choose the static data source you just created.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeTJpLipxfK7eKdCDPGcKZH3JSTtmDu6HAfgtXQpJMatPMsc_StkaUZXOS4W7vHt8BKeW5SjL-5yETy4Utvmu6X5JfNmUFRFfX04HBjW_wumV1j8PdAqRUWh_DMuBSEPaM9-IfRLw?key=S34iWzcIQkGQ9wgvCV6JXQ" alt=""><figcaption></figcaption></figure>

4\. Drag elements such as **H1**, **Text**, or **Image** into the Iterator.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXepAbG7cwlngeyd3C4t9m1TbpPGbC_qQqJHgUaz1zy9As9g5g7eqXTquklkuoHhMhZqKR97SRY_xg5Hwe8lTAaobBU2ZhJotTfvN1-Op-ZpkyqAVVn7NvyglHNQAeqvLScHQAoOwA?key=S34iWzcIQkGQ9wgvCV6JXQ" alt=""><figcaption></figcaption></figure>

5\. For each element, go to the **Properties** panel and bind it to one of the property keys you’ve defined (e.g., name, price, id).

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeOASafokq9WBtiYdQngyKP38SJZPbs1QNECMlAxvle1cL9btMyY_mVP-4RtGo63-XzBRPdWmOx8HrhrjrKgY2VswMdVR9zpgTd5jUxC7QqBTRqu_i_tqaH_KqpTMb_0MhGD4k6Kg?key=S34iWzcIQkGQ9wgvCV6JXQ" alt=""><figcaption></figcaption></figure>


---

# 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://docs.akinon.com/tutorials/project-zero/dynamic-widget/data-sources.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.
