Template Studio

A single page in the admin app where you create templates, browse your real Dataverse fields, check every token against the live schema, and preview the result — without leaving the browser or typing a field name by hand.

Opening it

VerseDocs AdminAuthoring Template Studio. Nothing to install or wire up — it ships in the managed solution.

On a fresh install the Studio opens on an empty gallery. That is expected, not a broken install: there are no templates until you create one.
The VerseDocs Template Studio template gallery listing five templates, four active and one retired.
The gallery. Green means active and generatable; grey means retired.

Creating your first template

  1. 1Click + New Template.
  2. 2Give it a name, and pick the bound table — the Dataverse table this template generates documents from. The picker is searchable, and filtered to the tables that are actually yours rather than all several hundred in the environment.
  3. 3Pick a starter: Letter, Invoice, Quote, or Blank. A starter is a real, editable document pre-filled with tokens for fields that exist on the table you chose — not a stub.
  4. 4For Invoice or Quote, optionally point the line items at a real one-to-many relationship of the bound table. Choosing one writes the loop against that child table’s own fields and adds the matching relationship to the template’s data binding, so line items actually resolve when you generate.
  5. 5Click Create Template. The row is created and its file uploaded in one step, then the template opens for editing.
Recording of creating a template: the New template dialog opens, a bound table is searched and chosen, the template is named, and it opens in the editor with tokens already in place
The whole flow, start to finish: an empty gallery, the New template dialog, searching for the bound table, and the finished template opening in the editor with its tokens already written.
The New template dialog with an Invoice starter selected and a searchable 'Where do line items come from?' relationship picker open
Choosing an Invoice or Quote starter reveals Where do line items come from? — a searchable list of the bound table’s real one-to-many relationships. Picking one writes the loop against that child table and adds the matching relationship to the template’s data binding.
What a relationship-bound Invoice or Quote leaves blank, and why. The document number, the total, and a quote’s “valid until” date are properties of the document, not of the record it is generated from — a contact row has no invoice number. So when line items are bound to a relationship, the starter writes those as labels with no token. You fill them in, or insert a token of your own. The alternative would be a token with nothing behind it, which does not sit there looking unfilled — it stops the document generating at all.
Pick the line-item relationship at creation time. With none selected, the Invoice and Quote starters emit a generic {{#each lines}} block that expects you to supply the array yourself. That is fine for a flow that passes its own JSON, but it will not populate from a record on its own.

The workspace

TabWhat it does
EditEdit the document in the browser and insert tokens as you go. This is where a starter becomes your letter, invoice or quote.
FieldsEvery readable field on the bound table, read live from Dataverse's own metadata, grouped and searchable, each showing the exact token to paste. Related tables the binding reaches get their own group.
ValidateParses every token in the template file and checks each field reference against that same live field list. This is the highest-value tab in the Studio.
Sample DataThe JSON used for preview. Inline “Invalid JSON” feedback rather than a silent failure, and a one-click formatter.
SettingsReplace the template file, review the binding manifest (the FetchXML that decides which related records are available), and activate or deactivate the template.
Template Studio showing the Edit tab of a Letter template, with tokens in the document and the Fields panel alongside
The Edit tab of a Letter starter. The document is real and editable, the tokens are ordinary text, and the Fields panel on the right lists the bound table’s actual columns — click one to insert its token at the cursor.

The right-hand column is a live preview, rendered through exactly the same actions a flow would call. Word templates render as an inline PDF; Excel and PowerPoint templates render natively with a download.

Live Preview rendering a letter as an inline PDF, stamped with a diagonal VERSEDOCS TRIAL watermark
Live Preview renders through the same engine a flow uses, and reports the page count and engine underneath. This environment is unlicensed, so the preview carries the diagonal VERSEDOCS TRIAL watermark — exactly what a generated document would show until a license key is applied.
The Sample Data tab holding a JSON object for an account with address fields and an array of line items.
Sample Data is the JSON the preview renders against. It never touches live records.

Token validation

The Validate tab catches the mistake that would otherwise surface as a TEMPLATE_FIELD_MISSING error days later, in production, in somebody else’s flow. It reports, for every distinct field the template references:

  • Whether it matches a real field on the bound table or a related table.
  • How many times the template uses it.
  • For anything unknown, a suggestion when a close match exists — “did you mean {{account.telephone1}}?”

It understands the way Word actually stores text, so a token split across several internal runs is still found and checked correctly.

Validation checks that a field exists. It cannot check that a field has a value on the row you eventually generate from — an empty field renders as an empty string, which is usually what you want, but it is worth reviewing a preview against a realistic record before going live.
The Validate tab reporting that all ten fields referenced in the template match the schema, with each token listed and its use count.
Every token is checked against the bound table’s real columns, with a count of how often each is used.

Data binding: how a template finds its data

Each template row stores a binding manifest — FetchXML naming the bound table and any related tables to pull in. When you generate from a record, that manifest is resolved against that record to build the data the tokens read.

A binding that reaches an account's contacts, and each contact's tasks
<fetch>
  <entity name="account">
    <all-attributes/>
    <link-entity name="contact" from="parentcustomerid" to="accountid" alias="contacts">
      <all-attributes/>
      <link-entity name="task" from="regardingobjectid" to="contactid" alias="activities">
        <all-attributes/>
      </link-entity>
    </link-entity>
  </entity>
</fetch>

Each alias becomes an array you can loop over — {{#each account.contacts}}, and inside it {{#each activities}}. The Template Syntax page covers the resulting data shape in full.

Edit the manifest on the Settings tab to add a <link-entity>, then revisit the Fields tab — the new table appears as its own group with ready-to-paste tokens.

The binding manifest field containing a fetch element for the account entity with a link-entity to vdocs_sampleline aliased lineitems.
The manifest is plain FetchXML. The alias is the name your {{#each}} loop uses.

Versions and retiring a template

Templates carry a version and an active flag. Only active templates appear in the Generate document picker, so the way to retire one without breaking history is to deactivate it rather than delete it — documents already generated keep their provenance stamp pointing at the template and version that produced them.

Every document generated from a record is stamped with its template id, template name, template version, the generating user, the generation timestamp and the VerseDocs version, written into the file’s own document properties. In Word that is File → Info → Advanced Properties → Custom; PDFs carry the equivalent metadata keys.

Authoring in Word instead

The Studio is not the only way. A template is an ordinary .docx, .xlsx or .pptx file: build it in Word, Excel or PowerPoint with all your own styling, type the tokens where the values go, and upload it with Replace file on the Settings tab. Use the Fields tab to copy exact token names, and the Validate tab afterwards to confirm every one of them resolves.

This is the right path for a document with real brand design — letterhead, precise tables, headers and footers. You do not lose anything by authoring in Word; tokens work in headers and footers too.