Mavenoid help center

Mavenoid help center

  • Admin
  • Flows
  • Agent dashboard

›Reference

Get started

  • Intro to flows
  • Tutorial - Create a flow for live support
  • Tutorial - Create a flow for troubleshooting
  • Tutorial - Create a flow for FAQs

Learn more

  • Understand the types of nodes
  • Working with symptoms and solutions
  • Working with backtracks and choice lists
  • Understand potential solutions
  • Understand escalation
  • Understand search
  • Understand step-by-step guides
  • Understand canvas notes
  • Understand form data
  • Understand markup
  • Understand secrets
  • Understand flow components
  • Understand conditions
  • Understand translations
  • Understand flow feedback
  • Best practices for writing flows

How-to guides

  • Preview nodes and flows
  • Embed images and files
  • Embed videos
  • Receive conversation transcript emails
  • Set a flow image
  • Work with step-by-step guides
  • Add canvas notes
  • Copy and paste nodes
  • Create and embed flow components
  • Work with conditions
  • Configure flow feedback
  • View and manage flow feedback
  • Export, import, and copy flows
  • Set flow visibility
  • Manage translations
  • Create a live support node
  • Create an external API node
  • Start the user on different nodes based on the embedding page
  • Dynamically populate a choice list

Reference

  • Text formatting
  • Live support settings
  • Actions settings
  • External API settings
  • Form field types
  • Reserved form data
  • Markup expressions and operators
  • Supported languages
  • Glossary of terms

Markup expressions and operators

For context on what markup can be used for, see Understand markup.

Node using markup to display form data

In every field that supports markup, values between double curly braces ({{...}}) are treated as markup. A number of expressions and operators can be used to modify data before it is stored.

Form data keys

Within markup, form data can be referenced by its key. For example, if you have form data keys name and city, you can reference them as follows:

Hello {{name}}! Your city is {{city}}.

In a conversation where the key name has been set to the value "User" and the key city has the value "New York", the above will evaluate to and display as this:

Hello User! Your city is New York.

This works with form data created by your flow and also with reserved form data created automatically by Mavenoid. For example, you can reference the reserved key $language-iso as follows:

Hello! We will show you resources in language "{{$language-iso}}."

If the conversation is occurring in English, the above will evaluate to and display as:

Hello! We will show you resources in language "en."

Conditionals

In most cases, referencing a key which is not set will result in an error. To reference a key which may or may not be set, you can prepend ? to its name.

For example, if you have a form data key order-status but may or may not have a form data key order-message, you can safely reference these values as follows:

Order status:
{{order-status}}
{{?order-message}}

If order-status has the value "Complete" and order-message has the value "Completed on Tuesday", the above will evaluate to and display as:

Order status:
Complete
Completed on Tuesday

Whereas if order-status has the value "Pending" and order-message is not set, the above will evaluate to and display as:

Order status:
Pending

Concatenation

There is not a concatenation operator as such, but you can simply reference multiple form data keys in sequence. For example, if you have form data keys first_name and last_name, you can reference them together as follows:

Full name: {{first_name}} {{last_name}}

If the key first_name has a value of "Example" and last_name has a value of "User", the above will evaluate to and display as:

Full name: Example User

Math

You can use +, -, *, and / as mathematical operators to add, subtract, multiply or divide any numbers or numeric form data. Parentheses are also supported for order of operations.

For example, if you have form data keys length with value "7", width with value "4", and balcony_area with value "21", you can write markup as follows:

Room area: {{length * width}} square feet
Balcony area: {{balcony_area}} square feet
Total area: {{(length * width) + balcony_area}} square feet
Total area for two rooms: {{((length * width) + balcony_area) * 2}} square feet

The above will evaluate to and display as this:

Room area: 28 square feet
Balcony area: 21 square feet
Total area: 49 square feet
Total area for two rooms: 98 square feet

Path expressions

You can use JSON path expressions to reference specific fields or values within arrays, maps, or JSON objects.

Member names or numbers

You can access specific members within an object or array by adding ["name"] to the relevant key, where "name" is the name of the member you are referencing.

For example, every conversation has a reserved form data key of $session with a value something like this:

{"id": "2C3874A", "url": "https://app.mavenoid.com/org/ORG-NAME/product/123456/s/2C3874A"}

To reference the "url" value within, you can write markup like this:

You can resume your session by visiting {{$session["url"]}} at any time.

The above would evaluate to and display as something like this:

You can resume your session by visiting https://app.mavenoid.com/org/ORG-NAME/product/123456/s/2C3874A at any time.

You can also use this to reference numbered elements in an array. For example, if you have a form data key screenshots that was used for an (image/video upload form field](reference-form-field-types#imagevideo-upload), the value of that form data might look something like this:

[
  {
    "fileUrl":"https://mavenoidfiles.com/12345678abcdefgh12345678",
    "fileType":"image/png",
    "fileName":"screenshot1.png"
  },
  {
    "fileUrl":"https://mavenoidfiles.com/ijklmnop12345678ijklmnop",
    "fileType":"image/png",
    "fileName":"screenshot2.png"
  }
]

If you wanted to retrieve the "fileUrl" for the zeroth uploaded file, no matter how many were uploaded, you can write markup like this:

You can see your uploaded file at {{screenshots["0"]["fileUrl"]}}

With the value shown above, this would evaluate to and display as:

You can see your uploaded file at https://mavenoidfiles.com/12345678abcdefgh12345678

Member wildcards

You can access all members within an object or array by using * as the member name. Values will be grouped into an array.

For example, if you have a form data key screenshots that was used for an (image/video upload form field](reference-form-field-types#imagevideo-upload), the value of that form data might look something like this:

[
  {
    "fileUrl":"https://mavenoidfiles.com/12345678abcdefgh12345678",
    "fileType":"image/png",
    "fileName":"screenshot1.png"
  },
  {
    "fileUrl":"https://mavenoidfiles.com/ijklmnop12345678ijklmnop",
    "fileType":"image/png",
    "fileName":"screenshot2.png"
  }
]

To access all "fileName" values no matter how many there are, you can write markup like the following:

You have uploaded the following files: {{screenshots[*]["fileName"]}}

With the value shown above, this would evaluate to and display as:

You have uploaded the following files: ["screenshot1.png","screenshot2.png"]

Iterators

You can iterate over members in an array using the following syntax:

{{#each $<IDENTIFIER> in <EXPRESSION>}}
<BODY-EXPRESSION>
{{#end}}`

For example, if you had the form data key products populated with the following JSON value:

[
  {
    "name": "Product 1",
    "url": "https://example.com/product1.html"
  },

  {
    "name": "Product 2",
    "url": "https://example.com/product2.html"
  },
]

You could turn it into a series of markdown links by writing markup like the following:

{{#each $product in products}}
[{{$product["name"]}}]($product["url"])
{{#end}}

Given the above value, this would evaluate to the following:

[Product 1](https://www.my-store.com/product1.html),[Product 2](https://www.my-store.com/product2.html)

Which would render as two markdown links.

For an example of using iterators to dynamically populate a choice list, see Dynamically populate a choice list - Iterator.

Last updated on 10/19/2022
← Reserved form dataSupported languages →
  • Form data keys
  • Conditionals
  • Concatenation
  • Math
  • Path expressions
    • Member names or numbers
    • Member wildcards
  • Iterators
Help center
AdminFlowsAgent dashboard
Product
Self-serviceLive supportWhy Mavenoid?PricingGet a demoTry it free
Learn
Customer storiesBlogWebinarsHelp centerROI calculator
Company
About usCareersPressContact us
© Mavenoid AB 2023 • Privacy policy