Stride
View Categories

Define the experience form (Config JSON)

2 min read

The Config JSON is the list of fields people fill in when they create an experience from a template. You can write it as JSON in the template editor, or edit it in a grid.

Config JSON #

Open the Config JSON panel in the template editor. It holds a list of fields, and each field looks like this:

The Config JSON panel in the template editor
The Config JSON panel in the template editor
{
  "order": 1,
  "exp_json_field": "headline",
  "id": "headline",
  "input": {
    "input_label": "Headline",
    "input_type": "text",
    "input_default_value": "Welcome",
    "input_helptext": "Shown as the main title"
  },
  "rules": { "is_mandatory": true, "min_length": "", "max_length": "" }
}
PropertyMeaning
orderThe field’s position in the form.
exp_json_field and idThe key the value is saved under in the experience JSON. Use dot paths for nested values, such as title.text. The HTML inserts the value with ${template.<exp_json_field>}.
input.input_labelThe label on the form. It’s also the column heading in the bulk upload sample file.
input.input_typeThe kind of field. See Input types.
input.input_default_valueThe value the form starts with. Not used by upload fields.
input.input_helptextThe help text shown by the field’s ⓘ icon.
rulesis_mandatory, min_length and max_length. Stride checks them when someone saves an experience or uploads a CSV file, so content errors are caught in Stride rather than on your site.
group (optional)group_id, group_title and order. Fields with the same group_id appear together in a collapsible section of the form, and sections follow their order.

Input types #

input_typeOn the experience form
textA single line of text.
numberA number.
radioA True / False choice.
dateA date.
color-pickerA colour or gradient picker.
rich-textareaFormatted text in a rich-text editor.
url-textareaA URL.
dynamic-textText edited in a pop-up from the field’s icon. Its value is kept in input.dynamic_field.
arrayA list: people add as many values as they need.
selectorA single line of text.
static-optionsA dropdown of the values in input.input_options. The default value must be one of them.
uploadA file upload, stored in your default Contentful integration. Set input.platform to contentful; max_media_size (such as 5MB) and accepted_media_types (such as image/png) are optional.

Edit in the grid editor #

  1. Click the pencil next to the Config JSON panel heading. The Config JSON window opens with one row per field.
The Config JSON grid editor with a reference row and two fields
The Config JSON grid editor with a reference row and two fields
  1. Double-click a cell to edit it. Choose the Input type from its dropdown.
  2. Use ⋮ on a row to Duplicate Row, Add New Row or Delete Row. To delete several rows, tick them and click Delete.
  3. Check the Status column: a green tick means the row is valid.
  4. Click Save to write the grid back into the Config JSON panel, then click Save in the template editor to keep the change.

When you edit in the grid:

  • The first row (row 0) is a reference row that shows an example field. It isn’t added to the JSON.
  • Columns marked * are required. Input default value is required when Is mandatory is on, except for upload fields, which need a platform instead.
  • static-options fields need at least one option, and order and id are set for you from the row order and Exp json field.

JSON schema #

The JSON schema panel, next to Config JSON in the template editor, describes the JSON that experiences produce. With the Config JSON it decides the template type. For templates that render HTML, its config_obj_key names the object in the HTML that holds the form values.

Related #