Documentation
Feedback
Guides
API Reference

Guides
Master DataMaster Data v2Dynamic expressions in Master Data v2
Using dynamic expressions in Master Data v2

Learn how to automate processes based on Document updates using dynamic expressions.

Dynamic expressions in Master Data v2 enable you to populate document fields dynamically, making it easier to automate tasks like sending personalized marketing emails or processing document updates. This guide explains how to configure and use dynamic expressions with JSON schemas.

Syntax

Dynamic expressions use placeholders to reference and retrieve values from Document fields, including nested fields. These expressions enable dynamic data usage in actions like sending emails or saving data to another entity.

  • Basic syntax: Use {!fieldName} to reference a top-level field. For example:

    _10
    {!email}

  • Nested fields: Use dot notation to reference fields within nested objects. For example:

    _10
    {!order.clientProfileData.email}

Before you begin

Before using dynamic expressions, ensure you have a JSON schema configured for your Data Entity in Master Data v2. For more information, refer to Creating JSON Schemas for a Data Entity.

Instructions

Step 1: Creating a trigger

Follow the instructions in the Setting up triggers guide to create a trigger in Master Data v2. This defines when the action will be triggered (e.g., Document creation) and what action will be taken.

Step 2: Configuring a trigger to use dynamic expressions

In the trigger's action object, use dynamic expressions to populate the desired fields. For example:


_15
{
_15
"v-triggers": [
_15
{
_15
"name": "email-notification",
_15
"active": true,
_15
"action": {
_15
"type": "email",
_15
"provider": "default",
_15
"to": "{!email}",
_15
"subject": "Welcome, {!name}!",
_15
"body": "Hello, {!name}. Your order ID is {!order.id}."
_15
}
_15
}
_15
]
_15
}

In this example, the to field dynamically retrieves the value of the email field from the Document, while the subject and body incorporate values from name and order.id.

Ensure all fields referenced in your dynamic expressions exist in the JSON schema of your Data Entity.

Step 3: Testing the trigger

Test the configuration using a sample document to validate your trigger configuration and the dynamic expressions. Here’s an example document:


_10
{
_10
"email": "customer@example.com",
_10
"name": "Alice",
_10
"order": {
_10
"id": "98765"
_10
}
_10
}

The expected output in the triggered email would be:


_10
To: customer@example.com
_10
Subject: Welcome to Our Store, Alice!
_10
Body: Hi Alice, thank you for your order #98765.

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
See also
Setting up triggers in Master Data v2
Guides
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page