Reference Number Template
Docwize users can create a template for reference numbers. This enables the generation of unique reference numbers for every document in the database. A reference number template can include a combination of static content and dynamic fields that pull from the metadata of a given document (such as its doc type, WBS, discipline etc). An auto-populating sequential iterator ensures that no documents share the same reference number, even if some static and dynamic fields are alike. The Jinja code that users can select from for creating the templates is located in the floating toolbar.

Floating Toolbar
Sample Reference Number Template
Here is a string of static and dynamic fields for a sample reference number template:
DRG-{{document.doc_type}}-{{locations[0].Code}}-STATIC-$DW_SEQ_XXXX$
| Field | Description |
|---|---|
| DRG | Will remain ‘DRG’ for all generated reference numbers as this is a static value. |
{{document.doc_type}} | Will become whatever the doc_type is against this document. |
{{locations[0].Code}} | Will become the first location’s code as we are getting the ‘0th’ element from the list. |
STATIC | Will remain "STATIC" as this is a static value. |
$DW_SEQ_XXXX$ | This is the special sequential iterator. This ensures there is a new number that is generated for every document. The amount of 'X's dictate how many 0s the number will be padded with (i.e. XXXX will produce 0001, XXX will produce 001, etc.). |
How to Create a Reference Number Template
| Step | Description |
|---|---|
| 1 | Navigate to the ‘New’ Module. Go to ‘Manage Records’ – ‘Create New Record’. |
| 2 | Inserts fields for metadata that will be dynamic fields in the reference number template (eg. WBS, discipline, doc type, etc.). |
| 3 | Insert a field into the record, name it (eg. ‘Reference Number’), and select ‘Reference Number’ under ‘New Section Type’. Add the new field to the record template. |
| 4 | Expand the field's options. In the section ‘Reference Number Template String’ populate the necessary template format with static and dynamic fields. NOTE: include the following jinja code: $DW_SEQ_XXXX$, adapting the padding as per your needs, in order to ensure the iterator is included. NOTE: include a 'dash' (-) between elements of the reference number template. |
| 5 | Save the record. |
How to Generate a Reference Number
| Step | Description |
|---|---|
| 1 | Navigate to the ‘New’ Module. Select the relevant record. (See 'How to Create a Reference Number Template' to create the relevant record.) |
| 2 | Complete the fields required in the record. |
| 3 | Click 'Save'. The pop-up dialog will include details of the generated reference number. This can be copy-pasted, downloaded, and/or a user can navigate to its Document Details dialog to upload the relevant document. |