Resolve Expressions in Page Properties Based on Fragment Data
(For advanced users) When a fragment accepts input parameters for page-level properties such as Title or Subtitle, these values can come from expressions that are evaluated within the scope of the page. For example, an Edit page's title could be Edit Employee John Doe, where John Doe is a value generated from fetched data to resolve the expression 'Edit Employee: ' + $variables.objectValue.firstName + ' ' + $variables.objectValue.lastName.
The firstName and lastName values are fetched by the fragment when the page loads and are exposed to the page through the $variables.objectValue variable, allowing the page to resolve the expression.
- value: The value that the fragment should pick as the title's value to show in a component in HTML markup, for example, Edit Employee John Doe.
- referencedFields: List of fields used to compute the value expression, for example, ["objectValue.firstName", "objectValue.lastName"].
The fragment combines the referencedFields with other fields from the edit page's dynamic form and passes it to a Call REST action to retrieve the data that the page needs to render correctly. Once the data is fetched, it is stored in a data variable (objectValue, for example) and exported to the page as a writeback input parameter, allowing the page to resolve the value expression.
To make this data exchange work, your fragment variables must be assigned the correct binding type subtype to provide information that VB Studio requires to generate suitable metadata and expressions: