Using queries in datasources
There are three different types of datasources you can create within eformity. Two of these three types have the option to use a query: query datasource and table datasource (query). In this article, we will tell you what queries are and how to use them.
What are queries?
You can use queries in several places within eformity. One of these places is in datasources. But what are queries? Datasources are tables of data. These tables can have an enormous number of rows and columns. Using a query, you select a specific section from the table.
Adding a query to the datasource
As you read in the introduction, you can add queries to two different types of datasources. In this paragraph, we will tell you how to add each type of datasource.
Step 1: Login to eformity.net
Managing and creating datasources is done from eformity's web environment. Therefore, you must first log in to this environment to use queries. The web environment can be accessed at yourcompanyname.eformity.net.
Step 2: Navigate to "Configuration"
Then you can navigate to the configuration section. You do this by first clicking on the hamburger menu icon.

A new element will now open on the left side of the page. This new element consists of up to five different tiles. Click on the "Configuration" tile.

Step 3: Go to the "Datasources" overview
Once the new page has loaded, you can click on "Datasources" in the menu to open the datasource overview. In the image below, this menu item is circled.

Step 4: Open the desired datasource
You now see an overview of all existing datasources. To add or modify a query, you must first select the desired datasource. You do this by clicking on the datasource. Then click the 'Open' button to view the options of the selected datasource.
Note!
You can only use queries with query datasources and table datasources (query). If you don't already have query/table (query) datasource, you can create them.

Adding/editing a query to a query datasource
If the desired datasource is a query datasource, after you click 'Open' you can click 'Edit' in the 'Query' section. You can then add a query or edit the existing one.

Adding/editing a query to a table datasource (query)
If the desired datasource is a table datasource (query), after you click 'Open' you can click 'Edit' in the 'Source' section. You can then enter the desired query or edit the existing query.

Examples of queries
Now that you know where to add or edit queries, you probably want to know what you can enter as a query. In this paragraph you will find some examples of different types of queries. There can be three different queries within eformity:
- JSON
- OData
- SQL
JSON queries
The first type of query you may encounter is JSON. These queries you"ll often use for third-party APIs. Below is an example of a JSON query:
groups/1234/members/{id}
OData queries
In addition to JSON, OData queries are also used within eformity. OData is used with data connectors from Microsoft, among others. Below is an example:
salesorders?$apply=aggregate(totalamount with average as averagevalue)
SQL queries
Finally, there are SQL queries. SQL is also a common way to extract data from databases. The block below shows an example of an SQL query:
SELECT name, id, age FROM users