1. Fields
  2. JSON Editor Field

Fields

JSON Editor Field

The JSON Editor Field allows for including custom JSON data in the form.

Basic Usage

Adds a JSON editor field to the fields of an action. This field can be configured to be editable or read-only using the readonly parameter.

loading...

Result

The field will be displayed as a JSON editor field in the form, as below: Preview of a JSON editor field in a form

The resultant data will be available in the stubpost.data as:

editor
        {
  "custom_data": {
    "key1": "value1",
    "key2": {
      "nested_key1": "nested_value1"
    },
  }
}

      

This can be substituted with eg. ~~stubpost.data.custom_data where required. Any value in the JSON editor field can be accessed using the key, eg. ~~stubpost.data.custom_data.key2.netsted_key1.

Parameters

params.readonly
optional
boolean

This parameter specifies whether the JSON editor field should be editable or read-only.

params.readonly_label
optional
string

This parameter specifies the label to be displayed when the JSON editor field is read-only.

See fields for common field parameters like validation and conditional rendering.