KBA-01348: Using Doc Template Computed Fields


Spitfire‘s bookmark templates created in Microsoft Word offer the ability to dynamically compute new values based on existing data in the document.  The WordTemplateConfig rules (see KBA-01323) can help you define your computed field values. Spitfire distributes several computed field definitions as defaults for WordTemplateConfig rules that you can review and dissect to help understand how this feature can be used.

Each rule is the name of the new field in the format alias.fieldname where alias is one of the standard aliases and fieldname is a unique name of your choosing.

Computed field formulas (specified in the Result Value) that return string values are scanned for ‘nested bookmarks‘.

For example, if you wanted Items in your template to be described using the word ‘Section‘ followed by the specification and paragraph, with a hyphen between the two (e.g., Section 09511 – 2.2), you could use DocItem.SpecPara as the rule name (because Specification and Paragraph are both in the DocItem alias).  The Result Value would hold the following formula:


Some other examples of Spitfire-defined rules for computed fields include:

  • sfDocRevision.PDaysImpact— This computed field uses a series of IIF functions to print a grammatically correct statement based upon the value stored in the Days Requested document field.
  • sfDocAddr.AddrBlock—This computed field uses the Nested Bookmark feature.  The computed result is a static string value, but the parts of the string that are in the form [prefix_alias_field] are processed as bookmarks and replaced by the correct document field value.  This allows a complex and common structure requiring 7 bookmarks to be inserted into the document as a single bookmark.
  • sfciCost.LineDescription—This computed field combines the two techniques.  A series of IIF functions is used to decide what to print and in some cases the result includes a reference to [DV_ciCost_Subcontract] so that the subcontract title can be inserted instead of the subcontract number.

The IIF function is only one of many useful functions available for use in computed fields.

Additional Comments:

Adding computed fields to your bookmark templates can be challenging.  Spitfire offers training and/or consulting services to assist you in developing complex template solutions. See also KBA-01374 for information on the @DV function.

KBA-01348; Last updated: October 6, 2016 at 13:24 pm;