REST bindings (tutorial)

Use bindings to supply additional information to a query at runtime. In this example we have:

  • An API endpoint that accepts a status field to filter a list of applications
  • A query named applications
  • An application that supplies data to the bindings of the query



Creating a binding

We can create a binding named status with a default value of all.




Using a binding

Using handlebars the binding can be referenced throughout the query in the following places:

  • URL
  • Params
  • Headers
  • Body
  • Transformer


Params example

The binding can be used as the value of a param of the same name. While the name can be shared it is not required.



Headers example

The binding can be used as the value of a header of the same name. As above the binding and header name may or may not be shared.



Body example

The binding can be used in any part of the request body. e.g. as the value of a JSON field.




Supplying data to a binding

In our application we have the following structure:



Form: Status Form

The form will hold the value of our selected status. This is the top-level component so that the value can be accessed by components nested underneath.

  • Type: Create
    • While this form does not create anything, this option is required to indicate that the input schema (the bindings) should be used rather than the schema returned by the query.
    • Update may also be used to the same effect.
  • Schema: applications
    • The input schema of our REST query


Options Picker: Picker

We use an options picker in the form to provide our possible status values.

506 2298
  • Field: status
  • Adds the selection to the form under the name status
  • Options source: Custom
    • Custom options are specified using the Define Options drawer


Data Provider: Applications provider

We use a data provider to run the REST query

  • Data: applications
    • The REST query

To link the query bindings to the form we use the bindings drawer:


The value of the binding is

{{ Status form.Fields.status }}

Which represents the status field in our form.




We are now able to:

  • Specify a binding used in a REST query
  • Specify where the value of that binding will be used using handlebars
  • Create an application that supplies data to the binding and runs the query