Accessing primedocs fields
primedocs provides numerous fields. These fields are text containers with an id whose content is determined during generation by the document functions and/or by a Connect call.
In web-capable templates, all profile data of the current user is available automatically. The most important document functions for this are:
- Forms — enables the entry of user data.
- Data — used to transmit data via the Connect interface.
- Fields — used to merge or transform data.
Depending on type and application, the document functions are inserted as the corresponding content controls. This creates a data binding between primedocs and the document. primedocs tracks these data bindings and validates the fields both during generation and during later updates.
Overview: field type per Office application
The following matrix shows which field types are directly supported in which Office applications:
| Word | Outlook (web) | PowerPoint | Excel | |
|---|---|---|---|---|
| Text | ✓ | ✓ | ✓ | ✓ |
| FormattedText | ✓ | ✓ * | ✓ | ✗ |
| WordContent | ✓ | ✗ | ✗ | ✗ |
| InlineWordContent | ✓ | ✗ | ✗ | ✗ |
| WordTableRows | ✓ | ✗ | ✗ | ✗ |
| Date | ✓ | ✗ | ✗ | ✗ |
| YesNo | ✗ | ✗ | ✗ | ✗ |
| Picture | ✓ | ✓ | ✓ | ✓ |
| Object | ✗ | ✗ | ✗ | ✗ |
| ObjectCollection | ✗ | ✗ | ✗ | ✗ |
* Outlook e-mails and signatures are only stored as HTML in the web-capable Outlook version. Global translations of type FormattedText can contain arbitrary HTML elements via the FormattedText field in Outlook templates and are therefore more flexible than those in Word or PowerPoint templates. For a list of the permitted HTML elements in Word and PowerPoint, see FormattedText.
Field types that cannot be used directly (✗) can be used via Text or FormattedText.
Word
primedocs allows fields to be linked directly within Word templates and embedded in snippets. This enables documents to be created dynamically and automatically — without manual rework.
Inserted content control per field type
| Field type | Content control |
|---|---|
| Text | PlainText |
| FormattedText | RichText |
| WordContent | RichText |
| InlineWordContent | RichText |
| WordTableRows | RichText (table row only) |
| Date | Date |
| YesNo | Cannot be inserted. |
| Picture | Image |
| Object | Cannot be inserted. |
| ObjectCollection | Cannot be inserted. |
Inserting a Forms field into a template
- Create a field in Forms.
- Open the Word template in primedocs.
- Place the cursor at the correct position in the document.
- Click «Bind field».
- In the «Select field» dialog, choose the Forms field from the dropdown list.
- Confirm with «Insert».
Placeholders for layout templates
Fields can be stored directly in content templates. For layout templates, placeholders must be created.
Placeholders for snippets
Snippets that are inserted during document generation via the $.snippets… JavaScript API also require suitable placeholders. These act as the link between the dynamic field data and the static text content of the snippets.
Snippet Placeholder- Allows the embedding of simple
Textor field references via$.getReference(...). - The placeholder's formatting is retained and not overwritten by the inserted content.
- Allows the embedding of simple
Snippet Block Placeholder- Supports the embedding of
FormattedTextandWordContent. - The formatting is fully taken from the inserted content.
- Corresponds to a complete paragraph in Word.
- Supports the embedding of
Snippet Inline Placeholder- Allows the embedding of
InlineWordContent, e.g. formatted text parts within a paragraph. - The content must consist of exactly one paragraph.
- The formatting comes from the inserted content and may differ from the surrounding text.
- Allows the embedding of
Snippet Table Row Placeholder- Used for the dynamic generation of table rows.
- The placeholder must enclose a complete table row.
- The expected content type is
WordTableRows, which can contain further sub-types (Text,WordContent,FormattedText,InlineWordContent).
Colour coding
In Word, content controls are highlighted in colour depending on type and mode. This makes them easier to distinguish visually during editing and review.
| Mode | Description |
|---|---|
| Editing mode | Content controls are colour-coded to show how they work. |
| Test mode | Additional highlighting in ⬛ if the content control should not be visible later. |
| After generation | The content controls are either hidden or shown in 🟦. |
Behaviour when using $.getReference(...)
Snippet placeholders can be linked directly to fields via the JavaScript API $.getReference(...):
- With field link: the field is inserted directly; the content control is retained and behaves like a regularly bound field.
- Without field link: static content is inserted; the original content control is replaced by the inserted content.
| Type | Content control colour |
|---|---|
| Field inserted directly («Bind field») | 🟦 |
Field inserted directly with word-UpdateBehavior="Disable" (only for FormattedText, WordContent, InlineWordContent, WordTableRows) | ⬛ in test mode, invisible after generation |
Snippet Placeholder | 🟨 in editing mode, invisible or 🟦 after generation |
Snippet Block Placeholder | 🟧 in editing mode, invisible or 🟦 after generation |
Snippet Inline Placeholder | 🟩 in editing mode, invisible or 🟦 after generation |
Snippet Table Row | 🟪 in editing mode, invisible or 🟦 after generation |
Placeholder in the layout | 🟩 in editing mode, 🟦 after generation |
PowerPoint
In PowerPoint, data binding is done via tags attached directly to shapes or slide objects. These tags act as identifiers through which content is dynamically assigned and updated.
| Tag | Description |
|---|---|
primedocs.FormattedText | Display the formatted content from a FormattedText field |
primedocs.Picture | Display an image |
primedocs.Placeholder.Picture | Master template: image placeholder |
primedocs.Placeholder.Text | Master template: text placeholder |
primedocs.Placeholder.Visibility | Master template: visibility placeholder |
primedocs.Text | Display a text |
primedocs.Visibility | Controls the visibility of an element |
primedocs.BringToFrontIfOverlapped | Can be enabled for elements in the slide layout or master. Ensures that these elements are not covered by an image placeholder but always stay in the foreground. Available from version 4.0.30114.0. |
Excel
In Excel, the data is managed via a hidden worksheet. This sheet contains the structured field data, which can be embedded into other areas of the file via formulas or cell references.