Binding API Responses to UI
Connect API call results to the UI and fill request values with tokens
2 min read
Once you've set up an API, it's time to connect the call result to the UI. The flow has two steps — call the API, then bind its response to the UI.
1. Calling the API
Adding an API Call action to an Action Flow sends an HTTP request and receives a response. Typically you connect it to the Page Appear event so data loads when the page appears.
The response comes in as a structured form — HTTPStatusCode, Data, and per-status fields.
2. Binding the Response to the UI
The response data you receive can be bound to components just like any other data. For example, binding an array received in the response to a List fills the UI with real data from the server.
To handle things differently based on the status code, use it together with Conditions & Branching. (Show the result on 2XX, an error message on 4XX, etc.)
Filling Request Values: Binding Tokens
When sending a request, you sometimes need to put dynamic values into the URL, headers, body, or auth values. This is where binding tokens come in.
{Parameters.field}— an input parameter value injected into this API/flow{Project.dataName.field}— a value from project data
These tokens are substituted with their actual values at the moment the request is sent. In the editor, you can easily insert tokens by tapping the { } picker or by typing /. For example, putting ?q={Parameters.keyword} in a search API's URL includes the search term the user entered in the request.
It's fine to have brace-delimited objects inside a JSON body. Only tokens starting with Parameters. / Project. are substituted, and ordinary JSON is sent as-is.