Layouts for feeds
Shape the form your users fill in when they add your feed to a segment.
Your goal
Give your users a clear form when they add your feed to a segment: properties grouped into sections, each shown with the right type of field, and labelled in their language.
Expected outcome
A plugin version carrying a layout JSON file and its translation files, so the feed form shows your sections, fields and labels instead of a plain list of properties.
What a layout is made of
A layout is bound to a plugin version. It is optional for other plugin types, which then show every property in a default layout, but mandatory for audience segment feeds.
It is made of:
A layout JSON file.
A non-empty list of translation CSV files.
The layout JSON file
The layout JSON file declares the elements of the form: the layout version, the sections to display, and the metadata.
{
"version": "V202005",
"sections": [
{
"title": "{{section_title}}",
"sub_title": "{{section_subtitle}}",
"fields": [
{
"property_technical_name": "property_1",
"field_type": "INPUT",
"label": "{{property_1_label}}",
"tooltip": "{{property_1_tooltip}}",
"placeholder": "{{property_1_placeholder}}",
"required": true
},
{
"property_technical_name": "property_2",
"field_type": "DYNAMIC_SELECT",
"label": "{{property_2_label}}",
"tooltip": "{{property_2_tooltip}}",
"placeholder": "{{property_2_placeholder}}",
"enum": null,
"required": true
},
{
"property_technical_name": "property_3",
"field_type": "MULTI_SELECT",
"label": "{{property_3_label}}",
"tooltip": "{{property_3_tooltip}}",
"placeholder": "{{property_3_placeholder}}",
"enum": [
{
"value": "category_1",
"label": "{{CAT_1_label}}"
},
{
"value": "category_2",
"label": "{{CAT_2_label}}"
},
{
"value": "category_3",
"label": "{{CAT_3_label}}"
}
],
"required": true
}
],
"advanced_fields": [
{
"property_technical_name": "segment_name",
"field_type": "INPUT",
"label": "{{segment_name_label}}",
"tooltip": "{{segment_name_tooltip}}",
"placeholder": "{{segment_name_placeholder}}",
"required": false
},
{
"property_technical_name": "segment_description",
"field_type": "INPUT",
"label": "{{segment_description_label}}",
"tooltip": "{{segment_description_tooltip}}",
"required": false
},
{
"property_technical_name": "customer_user_identifier",
"field_type": "INPUT",
"label": "{{customer_user_identifier_label}}",
"tooltip": "{{customer_user_identifier_tooltip}}",
"required": false
},
{
"property_technical_name": "continent",
"field_type": "SELECT",
"label": "{{continent_label}}",
"tooltip": "{{continent_tooltip}}",
"enum": [
{
"value": "NAM",
"label": "NAM"
},
{
"value": "EMEA",
"label": "EMEA"
},
{
"value": "APAC",
"label": "APAC"
}
],
"required": false
}
]
}
],
"metadata": {
"large_icon_asset_id": "13636",
"small_icon_asset_id": "13636",
"display_name": "{{section_title}}",
"description": "{{section_subtitle}}"
}
}Root
version
String
The version of the layout.
authentication
An authentication object, optional
The wording of the form a user fills in to authenticate a destination on your feed.
Sections
A form can display several sections, each made of fields and of an advanced fields part.
Fields
property_technical_name
String
The technical name of the property the field represents.
label
String
The label shown on the left of the field in the form.
placeholder
String
The text shown in an empty field, hinting at the expected format or an example value. Displayed only for TEXTAREA and every *SELECT type. Without one, the technical name is shown in PascalCase.
tooltip
String, optional
The help text shown in the tooltip on the right of the field.
enum
A list of enum objects, optional
The possible values of the field, used by SELECT, MULTI_SELECT, SWITCH, RADIO and CHECKBOX.
max_length
Integer, optional
The maximum length of the text, used only by TEXTAREA.
required
Boolean, optional
Whether the field is mandatory. Defaults to false.
Field types
TEXTAREAURLDATA_FILEHTMLNUMBERSELECTMULTI_SELECTDYNAMIC_SELECT- requires theonDynamicPropertyValuesQuerymethod in the plugin code.IMAGEINPUTINPUT_NUMBERSWITCHRADIOCHECKBOXDATEDATE_RANGE
Enum
value
String
The value given to the property.
label
String
The label displayed in the field.
Metadata
large_icon_asset_id
Asset ID
The asset of the large icon representing the plugin layout.
small_icon_asset_id
Asset ID
The asset of the small icon representing the plugin layout.
display_name
String
The plugin version's name, visible in the plugin listing and on the form page.
description
String
A description of the plugin version, visible in the plugin listing and on the form page.
The icon assets must belong to the same organisation as the plugin.
Authentication
The authentication object sets the wording of the form a user fills in to authenticate a destination on your feed. Which fields the form shows is decided by the plugin version's authentication type, not by the layout: the layout only sets their labels, their help texts and the OAuth 2.0 button. Every attribute is optional, and an attribute left out keeps its default wording.
button_label
String, optional
OAUTH2
The label of the button that starts the OAuth 2.0 flow. Defaults to Connect.
button_icon_asset_id
Asset ID, optional
OAUTH2
The asset of the icon shown on the button.
oauth2
An object with button_label and button_icon_asset_id, optional
OAUTH2
The same attributes, grouped under the authentication type they apply to. When set, they take precedence over the top-level button_label and button_icon_asset_id.
login
An authentication field, optional
LOGIN_PASSWORD
The login field. Its label defaults to Login / Email.
password
An authentication field, optional
LOGIN_PASSWORD
The password field. Its label defaults to Password.
You only set the asset IDs: the platform fills in the matching button_icon_asset_url attributes when it serves the layout.
Labels and help texts accept translation references, like any other value of the layout.
Authentication fields
label
String, optional
The label of the field.
tooltip
String, optional
The help text shown with the field.
The JSON schema
Translation files
Translation files localise the form: for a given layout JSON file, you provide one translation CSV file per locale.
In the layout JSON file, refer to a value by surrounding its name with double curly brackets: the value val is written {{val}}. These references can appear anywhere in the layout JSON file, for instance in a field label:
A translation CSV file has two comma-separated columns, under the header KEY,VALUE. The first column holds the keys, the names of the values (val above). The second holds what replaces each key when the form is displayed. The matching US English (en-US) file for the excerpt above:
Manage layouts
In Computing Console, choose your plugin, select a plugin version, and open Layout in the menu.
You should see at least two files: the properties layout and the
en-UStranslation. Open a file's options and select Edit to display and change its content.If these files are missing, create them with Add a properties layout, and Add a local for a translation.
Get the layout JSON file of a plugin version, with its translation tokens, or with the values of a locale when you add the locale query parameter, for example locale=en-US:
Upload the layout JSON file, sent as the request body:
Get or upload the translation file of a locale:
If an upload fails with JSON not structured as expected, validate your file against the JSON schema.
Verify
The layout JSON file validates against the JSON schema, and its upload is accepted.
A translation file exists for every locale you support, and every
{{key}}in the layout has a line in it.The feed form shows your sections, fields and labels when a user adds the feed to a segment.
Related pages
Last updated
Was this helpful?