On this page: Learn how to add editable form fields to code-based experience content templates so marketers can customize content in campaigns and journeys without editing code.

For both more flexibility and control over the code-based experiences, Journey Optimizer allows your development team to create JSON or HTML content templates containing specific predefined editable fields.

When creating a code-based experience, non-technical marketers can then directly edit these fields in the interface, without the need to even open the personalization editor, or to touch any other code elements in their journey or campaign.

This capability provides a simplified experience for marketing users while allowing developers more control over the code content, resulting in less room for errors.

Understand the form field syntax

To make portions of an HTML or a JSON code payload editable, you must use a specific syntax in the expression editor. This involves declaring a variable with a default value that users can override after applying the content template to their code-based experience.

For example, suppose you want to create a content template to apply it to your code-based experiences, and allow users to customize a specific color used in different locations, such as frames or buttons’ background colors.

When creating your content template, you need to declare a variable with a unique ID, for example “color”, and call it at the desired locations in the content where you want to apply this color.

When applying the content template to their content, users will be able to customize the color used wherever the variable is referenced.

Add editable fields to HTML or JSON content templates

To make some of your JSON or HTML code editable, start by creating a code-based experience content template where you can define specific form fields.

NOTE
This step is usually performed by a developer persona.
  1. Create a content template and select the Code-based experience channel. Learn how to create templates

  2. Select the authoring mode: HTML or JSON.

    CAUTION
    Changing the authoring mode will result in losing all of your current code. The code-based experiences based on this template need to use the same authoring mode.
  3. Open the personalization editor to edit your code content.

  4. To define an editable form field, navigate to the Helper functions menu in the left navigation pane and add the inline attribute. The syntax to declare and call the variable is automatically added in your content.

  5. Replace "name" with a unique ID to identify the editable field. For example, enter “imgURL”.

    NOTE
    The field ID must be unique and cannot contain spaces. This ID should be used everywhere in your content where you want to display the variable’s value.
  6. Adapt the syntax to suit your needs by adding parameters detailed in the table below:

    ActionParameterExample
    Declare an editable field with a default value. When adding the template to your content, this default value will be used if you do not customize it.Add the default value between the inline tags.{{#inline "editableFieldID"}}default_value{{/inline}}
    Define a label for the editable field. This label will display in the code editor when editing the template’s fields.name="title"{{#inline "editableFieldID" name="title"}}default_value{{/inline}}
  7. Click Preview form fields to check how the editable form fields will display in the code-based experiences applying this template.

  8. Use the {{{name}}} syntax in your code at every place where you want to display the value of the editable field. Replace name with the unique ID of the field defined earlier.

  9. Proceed similarly to add other editable fields, wrapping each of them with the {{#inline}} and {{/inline}} tags.

  10. Edit the rest of your code as needed, including the IDs corresponding to the editable fields you defined. Learn how

  11. Save your template.

Use decision policies in editable field forms

When creating a code-based experience content template, you can use a decision policy to leverage offers in your editable form fields.

  1. Create a code-based experience template as described above.

  2. Click Add decision policy either using the Show Decisioning icon from the right rail of the edition screen, or in the expression editor from the Decision policy section on the left menu.

    Learn how to create a decision policy in this section.

  3. Click the Insert policy button. The code corresponding to the decision policy is added.

  4. After the {{#each}} tag, insert the code corresponding to the editable form field(s) that you want to add, using the inline syntax described above. Replace "name" with a unique ID to identify your editable field. In this example, use “title”.

  5. Click Preview form fields to check how the editable form fields will display in the code-based experiences applying this template.

  6. Insert the rest of your code above the {{/each}} tag. Use the {{{name}}} syntax in your code at every place where you want to display the value of your editable field. In this example, replace name with “title”.

  7. Save your template.

Code examples

Below are a few examples of JSON and HTML templates, some of them including decision policies.

JSON template:

{{#inline "title" name="Title"}}Best gear for winter is here for you!{{/inline}}
{{#inline "description" name="Description"}}Add description{{/inline}}
{{#inline "imgURL" name="Image Link"}}Add link{{/inline}}
{{#inline "number_of_items" name="Number of items"}}23{{/inline}}

{
  "title": "{{{title}}}",
  "description": "{{{description}}}",
  "imageUrl": "{{{imgURL}}}",
  "number_of_items": {{{number_of_items}}},
  "code": "DEFAULT"
}
NOTE
When referencing the inline fields in the JSON payload:
  • String-type fields must be enclosed in double quotes.
  • Integers or booleans must NOT be enclosed in double quotes. (See the number_of_items field in the example above.)

JSON template with decisioning:

IMPORTANT
When you render string values from decision items in a JSON array, enclose the Handlebars expressions in double quotes. Keep the quotes around expressions inside the {{#each}} block; otherwise, the code-based experience may not render the offer array correctly.
{
"offer": [
{{#each decisionPolicy.fff709b7-7fef-4e4e-83d7-594fbcf196c1.items as |item|}}
{{#inline "title" name="Title"}}{{item._mobiledx.Title1}}{{/inline}} {{#inline "description" name="Description"}}{{item._mobiledx.Title2}}{{/inline}} {{#inline "imgURL" name="Image Link"}}https://luma.enablementadobe.com/content/luma/us/en/experience/warming-up/_jcr_content/root/hero_image.coreimg.jpeg{{/inline}}

{
"title": "{{{title}}}",
"description": "{{{description}}}",
"imageUrl": "{{{imgURL}}}",
"link": "https://lumaenablement.adobe.com/web/luma/home", "code": "DEFAULT"
},
{{/each}}
]
}
NOTE
Inline fields for which you want to use decisioning items need to be placed inside the decision policy block - between the {{#each}} and {{/each}} tags.

HTML template:

{{#inline "title" name="Title"}}Please enter title here{{/inline}}
{{#inline "imgSrc" name="Image link"}}{{/inline}}

<div class="TopRibbon__content"><img style="padding: 5px 10px;" class="TopRibbon__image" src="{{{imgSrc}}}" />{{{title}}}</div>
<style> .theme-luma .TopRibbon { background-color: #200098; }</style>

HTML template with decisioning:

{{#each decisionPolicy.f112884a-5654-43ad-9d6d-dbd32ae23ee6.items as |item|}}
{{#inline "title" name="Title"}}Title is: {{item._mobiledx.Title1}}{{/inline}}

<div class="TopRibbon__content"><img style="padding: 5px 10px;" class="TopRibbon__image" src="{{item._mobiledx.HeroBannerImage.sourceURL}}" />{{{title}}}</div>
<style> .theme-luma .TopRibbon { background-color: #200098; }</style>

{{/each}}

Edit form fields in a code-based experience

Now that the content template containing predefined editable form fields is created, you can build a code-based experience using this content template.

You will be able to easily edit the form fields from a code-based experience journey or campaign, without opening the personalization editor.

NOTE
This step is usually performed by a marketer persona.
  1. From the journey activity or the campaign edition screen, select the content template containing editable form fields. Learn how to use content templates

    CAUTION
    The templates available to choose are scoped to either HTML or JSON based on the channel configuration selected beforehand. Only compatible templates are displayed.
  2. The fields that were predefined in the selected content template are available on the right pane.

  3. From the Editable form fields section, you can:

    • Edit each value directly inside the editable fields, without opening the code editor.

    • Click the personalization icon to edit each field using the code editor.

    NOTE
    In both cases, you can only edit one field at a time, and you cannot edit the rest of the code-based experience content.
  4. If a decision policy was added to the content template, it comes with all the attributes available in the offers catalog schema. You can edit the decision item inline or using the expression editor. You can also change or edit the decision policy from the Decisioning section in the right rail, without opening the code editor. Learn more

  5. To edit the rest of the code, click the Edit code button and update your full code-based experience content, including the editable form fields. Learn more

How-to video

Learn how to add editable fields to code-based experience channel content templates.

AI Knowledge Reference

This section contains structured knowledge intended to support interpretation, retrieval, and question answering related to this topic.

For complete understanding, this information should be combined with the documentation on this page. Neither source is intended to stand alone; the page describes the feature, while this section provides additional context that helps disambiguate terminology, intent, applicability, and constraints.

  • TL;DR: This page explains how a development team adds predefined editable form fields to JSON or HTML code-based experience content templates, and how non-technical marketers edit these fields in a code-based experience journey or campaign without opening the personalization editor.

Intents:

  • Create a content template with the Code-based experience channel, select the HTML or JSON authoring mode, and declare editable form fields with the inline attribute from the Helper functions menu of the personalization editor.
  • Give each editable form field a unique ID, a default value between the inline tags, and a label with the name="..." parameter, and display the field value in the code with the {{{name}}} syntax.
  • Check how the editable form fields will display in the code-based experiences applying the template with Preview form fields.
  • Use a decision policy in a code-based experience content template so that editable form fields leverage offers, with the inline syntax placed between the {{#each}} and {{/each}} tags.
  • From the journey activity or the campaign edition screen, select a content template containing editable form fields and edit the field values from the Editable form fields section of the right pane.
  • Edit the full code-based experience content, including the editable form fields, with Edit code.

Glossary:

  • Editable form field (product-specific): A predefined field that a development team declares in a JSON or HTML content template, so that non-technical marketers can edit it directly in the interface when creating a code-based experience, without opening the personalization editor or touching other code elements in their journey or campaign. It is declared as a variable with a unique ID and a default value that users can override after applying the content template to their code-based experience.
  • Default value (product-specific): The value placed between the inline tags ({{#inline "editableFieldID"}}default_value{{/inline}}). When the template is added to the content, this default value is used if it is not customized.
  • Label (product-specific): The text defined with the name parameter (for example {{#inline "editableFieldID" name="title"}}default_value{{/inline}}). This label displays in the code editor when editing the template’s fields.
  • Authoring mode (product-specific): The format of the content template code, HTML or JSON.

Guardrails:

  • Changing the authoring mode of a content template results in losing all of the current code. The code-based experiences based on the template need to use the same authoring mode.
  • The field ID must be unique and cannot contain spaces. This ID should be used everywhere in the content where the variable’s value is displayed.
  • When referencing the inline fields in a JSON payload, string-type fields must be enclosed in double quotes, and integers or booleans must not be enclosed in double quotes.
  • When rendering string values from decision items in a JSON array, enclose the Handlebars expressions in double quotes and keep the quotes around expressions inside the {{#each}} block; otherwise, the code-based experience may not render the offer array correctly.
  • Inline fields for which you want to use decisioning items need to be placed inside the decision policy block, between the {{#each}} and {{/each}} tags.
  • The templates available to choose from the journey activity or the campaign edition screen are scoped to either HTML or JSON based on the channel configuration selected beforehand. Only compatible templates are displayed.
  • Whether editing a value directly inside an editable field or with the personalization icon, you can only edit one field at a time, and you cannot edit the rest of the code-based experience content.

Terminology:

  • Canonical name: Editable form field — variants: editable field, form field, inline field
  • Canonical name: Adobe Journey Optimizer — Acronym: AJO — variants: Journey Optimizer

FAQ:

  • Who usually performs each step? Adding editable fields to the content template is usually performed by a developer persona. Editing the form fields in a code-based experience is usually performed by a marketer persona.
  • How do I add the editable form field syntax to my template? In the personalization editor, navigate to the Helper functions menu in the left navigation pane and add the inline attribute. The syntax to declare and call the variable is automatically added in your content; replace "name" with a unique ID.
  • How do I add several editable fields? Proceed similarly for each field, wrapping each of them with the {{#inline}} and {{/inline}} tags.
  • How do I add a decision policy to a code-based experience content template? Select Add decision policy either using the Show Decisioning icon from the right rail of the edition screen, or in the expression editor from the Decision policy section on the left menu, then select Insert policy. The code corresponding to the decision policy is added.
  • What can I edit when the content template contains a decision policy? The decision policy comes with all the attributes available in the offers catalog schema. You can edit the decision item inline or using the expression editor, and you can change or edit the decision policy from the Decisioning section in the right rail, without opening the code editor.
  • How do I edit the rest of the code? Select Edit code and update your full code-based experience content, including the editable form fields.

Examples:

  • Content template with a color variable: to let users customize a color used in different locations, such as frames or buttons’ background colors, declare a variable with a unique ID, for example “color”, and call it at the desired locations. Users applying the template can customize the color used wherever the variable is referenced.
  • JSON template field: {{#inline "number_of_items" name="Number of items"}}23{{/inline}} is referenced as "number_of_items": {{{number_of_items}}} without double quotes, while {{#inline "title" name="Title"}}Best gear for winter is here for you!{{/inline}} is referenced as "title": "{{{title}}}".
  • HTML template with decisioning: inside the {{#each decisionPolicy.<ID>.items as |item|}} block, {{#inline "title" name="Title"}}Title is: {{item._mobiledx.Title1}}{{/inline}} declares a field whose value is displayed with {{{title}}}.

Related pages:

Personas:

  • marketer: Can select the content template containing editable form fields from the journey activity or the campaign edition screen. Can edit each value directly inside the editable fields from the Editable form fields section, without opening the code editor. Can select the personalization icon to edit each field using the code editor. When editing a value inside the field or using the personalization icon, only one field can be edited at a time, and the rest of the code-based experience content cannot be edited. Can select Edit code to update the full code-based experience content, including the editable form fields. Where: “Edit form fields in a code-based experience”.

Onboarding:

  • Level: Experienced
  • First minimal step: From the journey activity or the campaign edition screen, select the content template containing editable form fields.
  • Success check: The fields that were predefined in the selected content template are available on the right pane.
  • Previous: To make some JSON or HTML code editable, start by creating a code-based experience content template where specific form fields are defined: content template

Announcements

Get hands-on with agentic AI.

Explore how AI agents work together through real examples and hands-on practice. Join your local User Group to design an agent workflow with your peers and leave with a practical framework you can apply to your own work.

Find an event

Ask AI

Not sure where to start?
Ask me anything about Adobe products.

Type your question or pick a suggestion below.

Use of this AI chatbot is subject to Adobe's Privacy Policy. Don't share sensitive data. AI responses are not your Content, may be inaccurate, and any offers provided are non-binding. Generative AI Terms.

Ask AI