Skip to content

Basic Ruleset Techniques

Getting values from the form/document

In order to retrieve values as displayed and/or entered on the current form, we use the object ntf.document, followed by the name of the field.

The name of the field is the "name" property of the configured field/component within the corresponding template of the document being looked at.

ntf.document is basically a snapshot of the document as if it was saved at that moment.

Syntax

value = ntf.document.field-name;

Example

// Assuming fields 'firstName' and 'surname' exist on the template/document
var fullName = ntf.document.firstName + ' ' + ntf.document.surname;

Setting values on the form/document

In the same way as for getting values above, setting values is done simply by assigning to ntf.document.field-name.

Syntax

ntf.document.field_name = value;

Example

// Assuming fields 'firstName' and 'surname' exist on the template/document
ntf.document.firstName = 'Algernon';
ntf.document.surname = 'Blackwood';