Using Contextual Object Member Access

Use contextual member access in Wordize templates to reference current-scope members without repeating object identifiers.
What is this page about?

This page explains how contextual object member access works in Wordize LINQ Reporting templates.

It shows when you can use short member expressions such as <<[FullName]>> and when you should use fully qualified access such as <<[traveler.FullName]>>.

Contextual member access lets you omit an object identifier when the current scope already points to the object you need.

Core Idea

  • Inside a foreach body, the context is the current iteration item
  • Outside a foreach body, the context is the active data source

Because of this, both expressions can be valid in the same block:

<<[traveler.FullName]>>
<<[FullName]>>

Example: Explicit vs Contextual Access

Template with explicit access:

<<foreach [traveler in booking.Travelers]>>
- <<[traveler.FullName]>> (seat: <<[traveler.Seat ?? "pending"]>>)
<</foreach>>

Template with contextual access:

<<foreach [traveler in booking.Travelers]>>
- <<[FullName]>> (seat: <<[Seat ?? "pending"]>>)
<</foreach>>

Expected output in both cases:

- Avery Chen (seat: 12A)
- Noah Patel (seat: pending)

Nested Scope Behavior

In nested loops, contextual access resolves to the innermost loop item:

<<foreach [traveler in booking.Travelers]>>
Traveler: <<[FullName]>>
<<foreach [segment in traveler.Segments]>>
  - Segment: <<[From]>> to <<[To]>>
  - Traveler via explicit reference: <<[traveler.FullName]>>
<</foreach>>
<</foreach>>

Inside the inner loop:

  • <<[From]>> resolves against segment
  • traveler can still be used explicitly when needed

Practical Guidance

  • Use contextual syntax for short, readable row or list templates
  • Use explicit object names in deeply nested templates to prevent ambiguity
  • Mix both styles when it improves readability
Important to note:
If a template expression is difficult to follow at first glance, prefer explicit member access in that block.