Context tagging element

Use the Context tagging element to set a data context for its nested tagging elements. Context tagging elements simplify binding by allowing you to place multiple tagging elements within a specific data context without repeatedly specifying the full data path for each nested element.

Prerequisites

Set data context

Bind the Context tagging element to a data record or related entity that provides the context for nested elements.

  1. Select the Context tagging element to view its properties.
  2. In the Properties pane, locate the Value property and choose the value button to open the value binding panel.
  3. Under Source, select the data section that contains your data:
    • MainData - the primary data defined in the Data Model
    • GeneralData - system data and general information
    • Data Context - data context provided by a parent tagging element
  4. Under Path, navigate the data structure tree and select the data record or related entity that you want to set as the context.
  5. Choose the OK button (OK icon) to confirm the binding.
TIP

To use only select records from a collection, bind the Context tagging element to a Power Fx expression using Filter function. An example of a filter expression to select only Quote Lines where Quantity is larger than 1: Filter(Quote.QuoteLines, Quantity > 1)

Use data context in nested elements

Once the context is set, nested tagging elements can bind to the data context instead of specifying full paths. The value that the Context tagging element is bound to, directly becomes the Data Context for its nested elements.

  1. Place a Field tagging element or other tagging element inside the Context tagging element boundaries.
  2. In the Properties pane for the nested element, locate the Value property and choose the value button to open the value binding panel.
  3. Under Source, select Data Context.
  4. Under Path, navigate the data structure tree. You will see the fields and related entities from the context set by the parent Context tagging element.
  5. Select the specific data field you want to display.
  6. Choose the OK button (OK icon) to confirm the binding.
  7. Review results in Live Preview pane.
TIP

Use Context tagging elements when you need to display multiple fields from a related entity within a specific section of the template, such as showing product characteristic details (weight, color...) from a related Product characteristic entity on a quote template (Quote -> Quote Line -> Product -> Product characteristic).

Apply visual formatting

You can specify visual formatting rules on the Context tagging element to control the visual appearance of related content in the generated document in a dynamic, data-driven manner. For detailed steps, see Apply visual formatting to tagging elements.

Next steps