REST Field

REST Field

The REST field type enables you to issue a REST request in JSON or XML to an external web service and pull data from any API. The result of the request is stored in the REST field, and you can then access the result’s values through our existing JSONVAL() and XMLVAL() formula functions.

This field requires internet connectivity

You also need to ensure that the app user account being used is a Premium type, as the REST field is a Premium feature.

REST field vs REST connector

The REST field cannot be used to iterate through repeatable data in the request body as you can with a REST form connector.

Configuring your REST Field

Drag and drop the REST field from the left-hand toolbar onto your Form page, then configure it using the right-hand properties panel.

Rest Request

Provide the details of the REST web service request the app should issue.

  • Destination URL
    This can be built up using our formula builder.
  • REST Verb
    GET, POST, PUT or DELETE
  • REST Format
    REST services support default JSON and XML formats for input and output data. The default format is JSON.
  • Request Body
    Specify an optional payload in JSON or XML (depending on the format selected). Use our standard Data Template syntax to inject field values and formula results.

e.g.

{
'MyJsonProperty': '{{myfieldvalue}}'
}

Request Headers

Specify optional headers to be sent with the request. Use our standard Data Template syntax to inject field values and formula results.

e.g. {{myfieldvalue}}

Values will be URL encoded.

e.g. ‘Value@#$%‘ will become ‘Value%40%23%24%25

Dialog Message

This displays a custom dialog message while the request is being executed.

Request Trigger

Specify when the request should be executed.

On Form Load: Triggers the request to fire once the form has loaded successfully.

On Condition: Triggers the request once the specified condition is evaluated to be true.

A REST field that is set to run ON FORM LOAD needs to be on the first page of the form.

Request Condition

Controls when to execute this request by evaluating a formula with a true/false result.

e.g., NOTBLANK({{myActionField}}) will fire this request when myActionFields button is pressed.

REST Weather Example App

To help you get acquainted with this field type, we’ve created an example app published in our Examples Catalog.

This example app utilizes a free account at APIXU to demonstrate how to connect to an API to pull current weather information.

This account has limitations of 10,000 API calls per month.

To make use of this API in your own solutions, use the following Steps 1-4:

  1. The request requires an API key, which you can acquire by signing up for your own account.
    Get your own API Key on the link below:
    https://www.apixu.com/signup.aspx
  2. Next, update the hidden field, apiKey, with your key.
  3. Test or Publish the form
  4. Open the Form on your mobile device and select a country from the drop-down below.

Using the JSONVAL() formula to evaluate the response, the form populates fields with the current weather information.

Learn more about our data interchange formulas in our Formula Cheat Sheet.


    • Related Articles

    • Data Source Connector – REST

      The REST Data Source Connector allows you to pull data from an external API into a data source and populate its rows/columns for use in screens. This connector functions similarly to our REST Field (in-app REST requests) that can push or pull data ...
    • Form Connector – REST

      This Connector will be interesting if you have access to technical personnel (software developers) and want to tightly integrate with our platform. The REST Connector will automatically send form entry data in XML or JSON format to your specific web ...
    • REST Connector – Integrating with Zapier

      While our platform offers many native integrations, you can connect to over 5,000 apps by routing your form data through Zapier. By using our REST Connector as the trigger, you gain professional-level control over your data flow, including custom ...
    • Form Connector – REST 2-Step Scenario

      It’s common to encounter a scenario where you wish to interface with one API endpoint and then use the response as input data for another API interaction. To achieve this, our REST Field and REST Form Connectors support up to two steps in REST API ...
    • Connecting to REST with OAuth 2.0

      OAuth 2.0 is an authorization protocol that allows applications to access user data from other services without sharing the user’s credentials. It enables users to securely grant limited access to their resources on one service to another ...