JSON API Options

JSON API allows you to populate selections by making JSON calls to form elements utilizing the Form Options Data Store.

Configure JSON API

Configuring JSON API Options involves specifying the URL for the JSON call, defining the type of call, setting request headers, and configuring the request body. This feature lets you dynamically populate selections in form elements by making JSON calls to external APIs.

Fields to Configure:

  • JSON URL: URL to be called.
  • Call Type:
    Select the type of call:
    • GET
    • POST
    • PUT
    • DELETE
  • Request Headers: Add name(s) and value(s) to the request header.
    • Name: Name (or Type) of the Request Header.
    • Value: Link or Value of the Request Header.
  • Body Type (Applicable to POST or PUT):
    • Select the method for POST or PUT:
      • Request Parameters
        Add name(s) and value(s) to the request header
        Field Description
        Name Name (or Type) of the Request Header
        Value Link or Value of the Request Header
      • POST Parameters as JSON Payload

When POST Method is set to "POST Parameters", these parameters will be sent as a UrlEncodedFormEntity.

When POST Method is set to "POST Parameters as JSON Payload", these parameters will be sent as a StringEntity in a form of an escaped JSON string.

      • Custom JSON Payload 

Write your own JSON to be the payload. It will be sent as a StringEntity.

This option is available only when Custom JSON Payload is selected.

  • Passover Current Request Cookies: Check to pass Current Request Cookies to the server with the request.
  • Base JSON Object Name for Multirow Data: Name of the base JSON object (e.g., response).
  • ID Column: ID value from the specified JSON URL to set as the option value (e.g., response.id).
  • Label Column: Label value from the specified JSON URL to set as the option label (e.g., response.value).
  • Grouping Column: Grouping value from the specified JSON URL to set as the option grouping value (e.g., response.value).
  • Use AJAX for Cascade Options: Enables dynamic loading of available options based on the grouping column when dealing with many selections. For more information, see Dynamic-cascade-drop-downs.
    Not applicable to Form Data Store. Only available when used as an Options Data Store.
  • Add Empty Option: Empty option label. Only in use when the Add Empty Option is checked.
  • Don't trigger empty dependency value: Ensures that the dependent field's actions or changes are only initiated when the controlling field has a valid selected value. The JSON URL will not be called or triggered to the form when the controlling field value is empty.
  • Debug Mode: Show relevant debug entries in the server log for debugging purposes.

Form options caching

Caching options allow you to manage how often the JSON API Options are refreshed, which can significantly improve performance in environments with large datasets.

Configure the following fields:

  • Sync Cache Interval: Duration in seconds for cache synchronization activation.
    For example, with a setting of 180 seconds, background synchronization on the server occurs every 180 seconds to update with the latest data.
  • Pause Sync after Idle: Duration to wait before pausing synchronization after idle.
For large user datasets, increase Pause sync after idle for continuous cache updates. If dropdown selections are unlikely to change rapidly, set a longer Sync Cache Interval to avoid frequent cache updates.
Download the Sample App for a demonstration of JSON API Options:
Created by Julieth Last modified by Aadrian on Dec 19, 2024