Elements Connect

Fetch data from a data source (Connected items)

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, which 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.

API request configuration panel for a REST API data source in Elements Connect for a connected item (data source, HTTP method, REST endpoint, cache)

Data source

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

Method

The HTTP method used to retrieve data from the REST API. Two methods are currently supported:

  • GET: the standard method for read-only data retrieval. Simple to set up, no request body required.

  • POST: used when the API requires a request body to specify search or filter criteria.

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: Dynamic & cascading queries in Elements Connect.

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.

Data in API response section for a REST API connected item in Elements Connect, showing where to indicate the JSONPath location of the data

Location of the Custom field options in the response

In this field, indicate the JSONPath expression pointing to the data you want to retrieve in the API's JSON response. If the response is already an array at its root, leave this field empty.

Learn more in our JSON Path explained and 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.

Configuration Tester result panel for a REST API connected item in Elements Connect, showing the API response

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

You can build your SQL query in two ways:

  • Visual mode: an intuitive builder that lets you navigate your database schema (tables, columns) and generate the query automatically. Useful when you're less familiar with SQL syntax or the database structure.

  • SQL mode: write your query manually.

Visual mode
image-20240906-144835.png
SQL mode
SQL mode in Elements Connect for a connected item, writing a raw SQL query manually

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