Skip to main content
Version: Classic

Access to primedocs fields

There are numerous fields available in primedocs. primedocs fields are text containers that have an Id. The content of these fields is determined by the document functions and/or by a Connect call during generation.


Web-enabled templates

All profile data for the current user is automatically available in web-enabled templates.ng.

  • Forms document function: enables user data to be entered.
  • Data document function: used for data transfer via the Connect interface.
  • Fields document function: used for merging or transforming data.

Depending on the type and application, the document functions are inserted as corresponding content controls. This creates a data binding between primedocs and the document.
primedocs tracks these data bindings in the documents and validates the fields both during generation and during subsequent updates.

Overview of field types by Office application

As a supplement, the following matrix shows which field type can be used directly in which Office applications:

WordOutlook (web)PowerPointExcel
Text
FormattedText

*
WordContent
InlineWordContent
WordTableRows
YesNo
Picture
Object
ObjectCollection

*Outlook e-mails and signatures are only saved in HTML in the web-enabled Outlook version. This means that

note

Global translations of the FormattedText type can contain any HTML elements via the FormattedText field in Outlook templates and are therefore more flexible than global translations that are inserted in Word or PowerPoint templates. A list of permitted HTML elements in Word and PowerPoint templates can be found here:

Field types that cannot be used directly (✅

) can be used via Text or FormattedText etc.

Word

primedocs enables fields within Word templates to be linked directly and integrated into text modules. This allows documents to be created dynamically and automatically—without manual post-processing.

Overview of inserted content control per field type

The following table shows which field type is inserted into the template as which content control:

Field-TypContent control
TextPlainText (only text)
FormattedTextRichText
WordContentRichText
InlineWordContentRichText
WordTableRowsRichText (Only on table row)
DateDate
YesNoCannot be inserted.
PictureImage
ObjectCannot be inserted.
ObjectCollectionCannot be inserted.

How to insert a Forms field in the template

  1. Create a field in Forms.
  2. Open the Word template in primedocs.
  3. Place the cursor in the correct position in the document.
  4. Click on ‘Bind field’.
  5. Select the Forms field from the drop-down list in the ‘Select field’ dialogue.
  6. Confirm the selection by clicking on ‘Insert’.

Placeholders for layout templates

Fields can be stored directly in content templates. Placeholders must be created for layout templates.

Placeholders for snippets

Snippets that are integrated during document generation via the $.snippets...-JavaScript API also require the definition of suitable placeholders. These placeholders serve as links between the dynamic field data and the static text content of the modules.

image-20250827-084948.png

  • Snippet Placeholder:
    • Enables the integration of simple Text or field references via $.getReference(...).
    • The formatting of the placeholder is retained and is not overwritten by the inserted content.
  • Snippet Block Placeholder:
    • Supports embedding of FormattedText and WordContent.
    • The formatting is completely taken over from the inserted content.
    • Corresponds to a complete paragraph in Word.
  • Snippet Inline Placeholder:
    • Enables 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.
  • Snippet Table Row Placeholder:
    • Used for dynamic generation of table rows.
    • The placeholder must enclose a complete table row.
    • The expected content type is WordTableRows, which may contain further subtypes (Text, WordContent, FormattedText, InlineWordContent).

Color coding

In Word, content controls are highlighted in color depending on their type and the current mode. This makes it easier to visually distinguish between them when editing and reviewing templates.

Mode-dependent coloring

ModeDescription
Edit modeContent controls are color-coded to indicate their function.
Test modeAdditional highlighting in ⬛ if the content control should not be visible later.
After generationThe content controls are either hidden or displayed 🟦.

Behavior when using: $.getReference(...)

Snippet placeholders can be linked directly to fields using the JavaScript API $.getReference(...). The behavior differs depending on the implementation:

  • With field reference: If a placeholder is referenced to a field via $.getReference(...), the field is inserted directly. The content control remains intact and behaves like a regularly integrated field.
  • Without field reference: If there is no direct link, static content is inserted. In this case, the original content control is replaced by the inserted content.
TypeColor of Content Controls
Field inserted directly into template (“Bind Field”)- 🟦
Field inserted directly into template (“Bind Field”), which is marked with word-UpdateBehavior="Disable" (only applies to FormattedText, WordContent, InlineWordContent, WordTableRows)- ⬛ in test mode
- Invisible after generation
Snippet Placeholder- 🟨 in edit mode
- Invisible or 🟦 after generation
Snippet Block Placeholder- 🟧 in edit mode
- Invisible or 🟦 after generation
Snippet Inline Placeholder- 🟩 in edit mode
- Invisible or 🟦 after generation
Snippet Table Row- 🟪 in edit mode
- Invisible or 🟦 after generation
Placeholder im Layout- 🟩 in edit mode
- 🟦 after generation

PowerPoint

In PowerPoint, data binding is done using tags that are attached directly to shapes or slide objects. These tags serve as identifiers that can be used to dynamically assign and update content.

Tags

TagBeschreibung
primedocs.FormattedTextDisplay the formatted content from a FormattedText field
primedocs.PictureDisplay an image
primedocs.Placeholder.PictureMaster template: Picture placeholder
primedocs.Placeholder.TextMaster template: Text placeholder
primedocs.Placeholder.VisibilityMaster template: Visibility placeholder
primedocs.TextDisplay a text
primedocs.VisibilityControls the visibility of an element
primedocs.BringToFrontIfOverlappedCan be activated for elements in the slide layout or master. Ensures that these elements are not covered by an image placeholder and always remain in the foreground.

:::note
> Available from version 4.0.30114.0 onwards.

Excel

In Excel, the data is managed via a hidden worksheet. This sheet contains the structured field data, which can be integrated into other areas of the file using formulas or cell references.


“classic” templates

Some typical examples of primedocs fields - in the "classic" template world:

IdPossible contentDocument function
DocParam.SubjectMay contain the subject entered by the user in the document parameter dialog.DocumentParameter
Profile.User.EmailMay contain the e-mail address of the person who generates the document.ProfileData
Contact.Recipient.Selected.Person.FirstNameMay contain the first name of the recipient selected in the recipient dialog.RecipientAddresses
CustomElements.SenderAddressBlockMay contain the sender's address block created according to certain script rules.Scripts
MyExampleApplication.ProjectNoMay contain the project number from the Connect call of a specialist applicationCustomInterfaceConnector

These fields can be accessed from the document functions Scripts and Library for advanced binding (Extended bindings). They are stored in the generated document in the CustomXMLPart named OneOffixxDocumentPart.

Finally, it must be possible to reproduce the contents of the fields in the templates. Below is listed how this content is transferred to the documents in different scenarios.


“Classic” Word

In Word, primedocs fields are inserted with "Plain Text Content Controls". The primedocs classic Word add-in must be used as follows:

  1. Click on “Link content”
  2. Place cursor to the right position in the document
  3. Search the right field in the Content Controls pane and paste it by double clicking.

Word-Felder

Word itself also offers fields, for example, the page number, the document name or the print date. These already existed before Word 2007 and can be inserted with Ctrl+F9 or via Insert → Quick Parts → Field.... There are scenarios where it is desired that these fields are updated.

In the following situations, the Word fields are automatically updated:

  • When clicking on one of these buttons in the primedocs ribbon in the "Completion" group: Print, Send, Preview, Save PDF
    The update also takes place when "Cancel" is selected on any subsequent dialog.
  • When opening the document, if the user-defined document property "OORefreshFieldsOnOpen" is of type Boolean (Yes or No) and true (Yes).
  • When Saving the document, if the user-defined document property OORefreshFieldsOnSave is of type Boolean (Yes or No) and true (Yes).

The mentioned custom document properties can be set via the document function Metadata.


Outlook

warning

The new, web-enabled Outlook version is excluded from this.

Content

  • HTML: with "Plain text content controls", analogously to Word.
  • RichText: with RichText bindings; {IdDesOneOffixxElements}
  • Text: with text bindings; {IdDesOneOffixxElements}

These three types can be inserted via the primedocs Outlook add-in as follows:

To, Cc, Bcc and subject field

In e-mail templates the To, Cc, Bcc and subject fields are inserted with bindings: {primedocsElementId}. Here primedocs fields can also be composed of other text.
Examples:

  • {DocParam.Subject} becomes Anfrage
  • Nr.: {DocParam.ProjectNo} becomes Nr.: 110475
  • {CustomElements.SmsPhoneNumber}@smsservice.mycompany.com becomes 41123456789@smsservice.mycompany.com