Skip to content

Binding

Info

The feature described in this topic is meant for application targeting Mobile Development Kit 4.3 or newer.

From Mobile Development Kit 4.2 or older, see Object Binding.

This topic describes about binding. Binding always uses single curly braces '{}' and can be combined. It also supports Target Path. Binding consist of segments that resolve a complex data type. The value of the final segment is also the result of the binding. Bindings are often used in metadata to retrieve data that is bound to the current context of the action or control or page. You can set object binding to any control's or action's properties that accept Object Binding as value.

For example, if the current binding context contains:

{
    "OrderId": "12345",
    "ProductName": "Product A",
    "ProductPrice": 100,
    "Category":
    {
        "CategoryName": "Category Y"
    }
}

Use the following binding to get a value from a binding property called ProductName that is inside the current binding context:

{
    "Title": "{ProductName}"
}

You can also use '/' as separator for multi-level data structure, like complex OData type.

{
    "Subhead": "{Category/CategoryName}"
}

You can also combine the binding:

{
    "Description": "My Product: {ProductName} is priced at {ProductPrice} displayed for user {#Application/#ClientData/UserId}"
}

Target Path are strings that are interpreted at runtime. A target path is composed of segments that are resolved one after the other, with the result of one being used for the evaluation of the next. A target path is built from segments that are separated by a slash ("/").

Example: To get the value from a control with name MyInput in your current page via the #Control target path:

{
    "ProductName": "{#Control:MyInput/#Value}"
}

Last update: July 21, 2020