Using JMESPath expressions

Use JMESPath expressions to map and transform JSON response from webhook action into the desired data structure.

Example of using JMESPath expression in your output attributes mapping

Be aware of the following:

  • If your JMESPath expression is incorrect or points to non-existent fields, the output attribute value will be empty.

  • If the resulting value of your JMESPath does not match the target attribute type, the attribute value will also be empty.

Resources on JMESPath:

Examples

Select a Single Field

Input JSON
JMESPath

Expression: name Output:

Access Nested Fields

Input JSON
JMESPath

Expression: user.profile.location Output:

Select Multiple Fields

Input JSON
JMESPath

Expression: {name: name, email: email} Output:

Select all array element's properties

Input JSON
JMESPath

Expression: products[*].name Output:

Filter array by condition

Input JSON
JMESPath

Expression: items[?inStock == `true`] Output:

Select root-level array

Input JSON
JMESPath

Expression: @ Output:

Use bult-in functions

Input JSON
JMESPath

Expression: max(products[*].price) Output:

Select array elements for a form message with dynamic data

You can create a from message with dynamic data retrieved from a webhook action. For example:

Input JSON
JMESPath

Expression: products[*].{key: sku, value: name} Output:

This can then be used as a data source for your searchable select in a form message.

Last updated