Skip to main content
Skip table of contents

Fetch data from a data source

The first step in configuring a connected item consists in setting up the way it fetches data from an external data source. This data source can be either a REST API or a database, with brings some changes in how the configuration is done.

Fetch data from a REST API

API request

In this section you will be able to specify how your data will be retrieved.

image-20240906-095940.png

Data source

This is the REST API from which your data will be fetched and put in your connected item.

Method

This is the HTTP method to retrieve your data from the REST API. Currently, you can choose between two methods: GET and POST.

If you select POST, you will be asked to specify your request body.

REST endpoint

This field is prefilled with the URL of your API, as it was defined in the data source configuration. You can complete here with the appropriate endpoint to reach the data you need.

Learn more in our Query guide.

Cache

How does cache / caching data works in Elements Connect?

Data in API response

This section is used to defined where the data you want to display in the connected item can be found in the API response.

image-20240906-142600.png

Location of the Custom field options in the response

In this field, you need to indicate the path to the data that needs to be retrieved in the response JSON of the API. If this response is an array, you need to leave this field empty.

Learn more in our Template guide.

Results

You can use this configuration tester to check that your API request has been correctly set up, that it retrieves the expected information, and to see the response.

image-20240906-143855.png

Learn more: Configuration tester

Fetch data from a database

Database query

Data source

This is the database from which your data will be fetched and put in your connected item.

SQL query

In this section, you can either configure your query manually (SQL mode), or use our visual tool to navigate among your data source structure and create your query more easily (visual mode).

Visual mode
image-20240906-144835.png
SQL mode
image-20240906-144958.png

Cache

How does cache / caching data works in Elements Connect?

Results

You can use this configuration tester to check that your SQL query has been correctly set up, that it retrieves the expected information, and to see the response.

The results can be displayed in either a JSON or table format.

Learn more: Configuration tester

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.