Overview
This article explains how to implement InfoSheet blocks in precedents using merge fields in Microsoft Word, and how the Fields tab of the OneLaw Templates panel places and maintains the block markers for you.
It is a behavioural deep-dive for Template Administrators and advanced users who are already building complex InfoSheets and blocks and need to structure them correctly in precedents.
The article focuses only on the merge field block syntax used in Word documents, including Start and End markers, nested blocks, and the reserved block properties available during document assembly.
It does not cover how to create or configure blocks, fragments, or InfoSheets, or the extended marker syntax for filtering, ordering, and referencing a single block instance. Those workflows are documented separately and are assumed knowledge.
Who can do this
- System Administrators
- Template Administrators
Before you start
- Ensure the precedent you want to work in is open in Word, and that you have Template Administrator access. The Author Templates group, on the OneLaw tab, appears only for Template Administrators.
- Check the precedent is set to Full automation on the Settings tab. Blocks are not available on Partial.
- Check the InfoSheet holding the block is attached to the precedent. Blocks work whether the InfoSheet is embedded or referenced.
- Know how the block is configured in the InfoSheet: its block list code, its block item code, whether it repeats or is conditional, and whether it has separators. The marker names come from that configuration. See Create and Configure InfoSheet Blocks (Repeating, Conditional, and Nested).
- Be comfortable working with merge fields in Word, including showing field codes so the markers themselves are visible.
Important: Merge Fields Required for Blocks
InfoSheet blocks are supported only with merge fields. Block start and end markers are not supported using content controls.
A content control placed inside a block stops the block working, and the panel reports it on the Overview tab.
Because blocks depend on merge fields, they are only available on a precedent set to Full automation. On a precedent set to Partial, the Fields tab lists no blocks at all.
Note: Content controls may still be used elsewhere in the document for non-block InfoSheet fields.
Basic Block Syntax
All InfoSheet blocks in documents use a Start / End merge field structure.
A block structure consists of:
- A block list start marker
- A block instance start marker
- One or more fields within the block
- A block instance end marker
- A block list end marker
Canonical Syntax
The two start markers sit adjacent to each other, then the content for one instance, then the two end markers, also adjacent:
{ MERGEFIELD Start:InfoSheetPrefix.BlockElementName }{ MERGEFIELD Start:BlockTypeName }
{ MERGEFIELD FieldName }
{ MERGEFIELD separator }
{ MERGEFIELD End:BlockTypeName }{ MERGEFIELD End:InfoSheetPrefix.BlockElementName }
How Block Syntax Is Interpreted
The Start and End markers define how OneLaw processes block data during document assembly.
- Start:InfoSheetPrefix.BlockElementName marks the beginning of the block list (all instances of the block)
- Start:BlockTypeName marks the beginning of a single block instance
- Fields such as Name, and reserved properties such as separator, are accessed within the block instance
- End:BlockTypeName marks the end of the current block instance
- End:InfoSheetPrefix.BlockElementName marks the end of the block list
The system automatically repeats the content between Start:BlockTypeName and End:BlockTypeName for each block instance captured in the InfoSheet.
The list markers delimit the whole list and the instance markers delimit a single instance, so what repeats is whatever sits between the instance markers, whether that is a paragraph, a page break, or a table row. This is why each pair sits together, and the panel keeps them together whenever it writes a block.
Example: Basic Repeating Block
For an InfoSheet with:
- Prefix: Property
- Block element name: Chattels
- Block type name: Chattel
- Field: Name
{ MERGEFIELD Start:Property.Chattels }{ MERGEFIELD Start:Chattel }
{ MERGEFIELD Name }
{ MERGEFIELD separator }
{ MERGEFIELD End:Chattel }{ MERGEFIELD End:Property.Chattels }
Nested Blocks
InfoSheet blocks can be nested by repeating the same Start / End structure at each level.
Each nested block:
- Has its own Start and End markers
- Is fully contained within its parent block instance
- Is named relative to its parent, so its markers only work between that parent's instance markers
Example: Nested Blocks
{ MERGEFIELD Start:Property.Chattels }{ MERGEFIELD Start:Chattel }
{ MERGEFIELD Name }
{ MERGEFIELD Start:WarrantyDetails }{ MERGEFIELD Start:WarrantyDetail }
{ MERGEFIELD Provider }
{ MERGEFIELD End:WarrantyDetail }{ MERGEFIELD End:WarrantyDetails }
{ MERGEFIELD End:Chattel }{ MERGEFIELD End:Property.Chattels }
In this structure:
- Warranty details repeat within each chattel instance
- The same block rules apply at each nesting level
Reserved Block Properties
Each block instance automatically includes a set of reserved properties that can be used as merge fields within the block.
Available reserved properties:
- index, the position of the instance within the block (starting at 1)
- count, the total number of instances in the block
- is_first, true only for the first instance in the block
- is_last, true only for the last instance in the block
- separator, the resolved separator text for the instance, based on the block's separator configuration
These properties are available only within a block instance, with one exception: count describes the list rather than an instance, so it can also be used outside the block markers, where it gives the total number of instances.
With the cursor inside a block, the Fields tab re-roots to that block and lists these properties at the bottom of Fields in this item, where they insert like any other field. separator is listed only where the block has separators configured.
Example: Using Reserved Block Properties
{ MERGEFIELD Start:Property.Chattels }{ MERGEFIELD Start:Chattel }
{ IF "{ MERGEFIELD is_first }" = "true" "The following chattels are included:" "" }
{ MERGEFIELD Name } - { MERGEFIELD Value }
{ IF "{ MERGEFIELD is_last }" = "false" ", " "" }
{ MERGEFIELD End:Chattel }{ MERGEFIELD End:Property.Chattels }
In this example:
- Introductory text appears only for the first instance
- A separator is conditionally applied between instances
- The final instance is handled differently using is_last
How the Panel Places the Markers
You do not have to type block markers by hand. With a precedent open, the Fields tab of the OneLaw Templates panel lists the attached InfoSheet's blocks under Blocks, below the field tree, and writes the markers for you.
Selecting the + on a block opens its insert options, where Iteration layout sets how the instances repeat:
- Across paragraphs (one each) for one instance per paragraph, the default
- Within a paragraph (inline list) for a run of instances in a sentence
- Across pages (one per page) for one instance per page
- In a new table (row each) for an empty table that repeats as a whole, with Rows and Columns to set
If the cursor is already inside a table, Bind an existing table row is the only option, and the rows selected before inserting are the rows that repeat.
Marker scaffold to insert previews exactly what will be written, and Insert markers writes it. The content for one instance is then added between the instance markers.
Once a block is in the document, placing the cursor inside it re-roots the Fields tab to that block, so its own fields are listed under Fields in this item and any nested blocks under Blocks in this item. Selecting Edit on the location bar opens the block's settings, headed Repeating block, which is also where a block can be removed.
Filtering and Ordering Instances
A block writes every instance, in the order they were entered. That can be narrowed or reversed without editing the markers, from Filter & order in the block's insert options or its settings.
- Only matching items (Filter) keeps just the instances where a chosen field matches a value. Text, checkbox, and choice fields are offered, because those are the ones that match reliably. Spaces are stripped from the value as it is written into the marker, so a value containing a space never matches, and the panel warns when one is typed.
- Order offers Normal order, Reverse (always), and Reverse when a field is set. The controlling field can come from any InfoSheet attached to the document, so a Prompt InfoSheet can decide the order at assembly.
The filter is applied first, then the order, and the panel writes both onto the start and end list markers identically.
For the marker syntax behind these, including referencing a single instance by position, see Merge Field Syntax for InfoSheet Blocks (Advanced).
How Marker Problems Are Reported
The panel checks the document's block markers as you work. The Overview tab shows ✓ No issues, or ⚠ followed by the number of things to check.
Selecting Review lists the issues. Each one has a Go to button that selects it in the document, and, where the problem can be corrected automatically, a Repair button.
The check reports problems such as a start marker with no matching end, an end marker with no matching start, an end marker that does not match its start, a space in a marker name, and a content control placed inside a block.
Where an end marker does not match its start, the block's settings also offer Repair this block, which rewrites the end marker to mirror the start.
Note: ▶ Test on the Overview tab appears only once the marker check reports no issues, so a block problem has to be resolved before the precedent can be test-assembled.
Result
When InfoSheet blocks are used in a precedent:
- The content between the instance markers is written once for every instance captured in the InfoSheet
- A conditional block, or one with no instances, drops out of the assembled document entirely
- The panel writes matching marker pairs, and the Overview tab reports any marker problems it finds, with Test unavailable until they are resolved