API Call Query
You can use the API Call Query to trigger an API call automatically as soon as the page or widget is loaded. This is helpful if you want to retrieve the data from an API call and display it on a page or widget. For example, showing a list of items in a ListView, showing users details on several Text widgets.
Before you add this query, ensure you create an API call in your project
Adding API Call query
Adding API call query comprises the following steps:
1. Querying API call
Go to your project page and follow the steps below to define an API Call backend query:
-
Select the widget (or page) on which to apply the query.
-
Select Backend Query from the Properties Panel (the right menu).
-
Select the Query Type as API Call.
-
Choose the API Group or Call Name from the dropdown. It would display all the API Calls created in your project.
-
If your API call requires variables (e.g., auth token, query parameters, user id, etc.), pass their value by clicking on the + Set Additional Variable button.
-
Click Confirm.
2. Showing query data in UI element
Once you have the API Call query defined, you can use the data retrieved from the query to display on widgets present inside. Follow the steps below:
-
Select the widget (e.g.,
Text
) on which you want to display the data. -
From the Properties Panel, select Set from Variable.
-
Select the Source as the YOUR_API_CALL_NAME Response.
-
Set the API response Options to JSON Body.
-
Set the Available Options to JSON Path.
-
Set the JSON Path Name to either the custom JSON path or use the already created JSON path. See how to create a JSON path.
-
Click Confirm.