Links

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.
API call query

Prerequisites

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. Quering API call

Go to your project page and follow the steps below to define an API Call backend query:
  1. 1.
    Select the widget (or page) on which to apply the query.
  2. 2.
    Select Backend Query from the Properties panel (the right menu).
  3. 3.
    Select the Query Type as API Call.
  4. 4.
    Choose the API Group or Call Name from the dropdown. It would display all the API Calls created in your project.
  5. 5.
    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.
  6. 6.
    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:
  1. 1.
    Select the widget (e.g., Text) on which you want to display the data.
  2. 2.
    From the Properties Panel, select Set from Variable.
  3. 3.
    Select the Source as the YOUR_API_CALL_NAME Response.
  4. 4.
    Set the API response Options to JSON Body.
  5. 5.
    Set the Available Options to JSON Path.
  6. 6.
    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.
  7. 7.
    Click Confirm.