AI agents: the content index is at /llms.txt. Every page is also available as Markdown — send the request header Accept: text/markdown, or append .md to the page URL.
Xperience Docs

Cookie consent

We use necessary cookies (opens in a new tab) to run our website and improve your experience while browsing. Additional cookies are only used with your consent. You may revoke your consent on the Cookies Policy (opens in a new tab) page or in your browser at any time.

Configure (opens in a new tab)
  • Documentation
    InstallationUsing the Xperience interfaceDeveloping websitesConfiguring XperienceManaging usersSecuring websitesDeploying websitesManaging website contentMultilingual websitesMacro expressionsExternal utilitiesIntegrating 3rd party systemsCustom developmentE-commerce featuresOn-line marketing featuresRelease notes - Xperience 13Xperience terminology glossary
  • Tutorial
    Using the Xperience interfaceDeveloper tutorialBusiness tutorialResource hub for marketers
  • API Examples
    ConfigurationContent managementDevelopmentE-commerceOn-line marketingSocial media
  1. Home
  2. Managing website content
  3. Forms
  4. Using macros with forms

Using macros with forms


Was this page helpful?

Send us feedback Go back to top
  • Community Questions & Answers (opens in a new tab)
  • Contact support (opens in a new tab)

When configuring forms, you can set values dynamically using macro expressions. Forms support only basic macro expressions, typically of the following types:

  • Form data macros
  • Localization macros

Macros that retrieve values from other various types of advanced contexts may not resolve correctly when the form is submitted by a visitor on the live site.

Form data macros

When configuring a form, you can use values from the context of the specific form data submitted by the user. This can be achieved using macros in the {%field_name%} format. The field_name part of the macro is the Name of a particular form field, as shown on the Form builder tab (not the Label value displayed next to the field in the actual form). When the form is submitted, the macros are automatically resolved and replaced with data from the form.

These macros can be used in the following text fields:

  • General tab
    • Display text
    • Redirect to URL
  • Email notifications
    • Sender email
    • Recipient emails
    • Subject
    • Email body
  • Autoresponder emails
    • From email
    • Subject
    • Email body

Example 1

When configuring notification emails for a form, you may use the following values:

  • Subject: Form submitted by {%FirstName%} {%LastName%}

FirstName and LastName are the names of fields in the form. As a result, the notification email subjects will contain the first and last name submitted by the user in the related form record.

Example 2

If you enter the Display text value on the General tab of the form like this:

  • Dear {%FirstName%}, thank you for your message. We will contact you shortly.

The text will be resolved as the following when "Jane" was entered in the First name field by the user:

  • Dear Jane, thank you for your message. We will contact you shortly.

Form text localization

If you need to display the form on a multilingual website, you can localize field captions and other text strings using localization macros, for example:

  • {$myform.fullname$}
  • {$=Hello|de-de=Hallo|it-it=Ciao$}

To learn more, see:

  • Localizing form fields
  • Localizing text fields