Referencing previously created documents using UNID in one-touch Domino setup

Starting with 14.5.1 FP1, this feature enables one-touch setup scripts to store the UNID of a document being created with a label. This is obtained using the referenceName property which can then be added as an item on subsequent documents. This is useful for configuring documents which need to reference other documents.

For example, the .json fragment creates a new document and saves the UNID of the newly created document with the label "MainTopicTwo".
"documents": [
{
"action": "create",
"referenceName": "$UNID:MainTopicTwo", <<< save the UNID of this document with the label MainTopicTwo
"items": {
"Form": "Main Topic",
"From": "CN=Sherlock Holmes/O=sherlock",
"Subject": "this is main topic two",
"TextExample": "Yellow",
"TextListExample": [ "Red", "Green", "Blue" ],
"NumberExample": 42,
"NumberListExample": [ 20.21, 20.22, 20.23, 20.24 ]
}
This label can then be referenced when creating subsequent documents by referencing it in the item's data field as shown:
"documents": [
{
"action": "create",
"referenceName": "$UNID:MainTopicThree",
"items": {
"Form": "Main Topic",
"From": "CN=Sherlock Holmes/O=sherlock",
"Subject": "main topic three",
"TopicTwoUNID": "$UNID:MainTopicTwo", <<< this document will have an item named TopicTwoUNID which will contain the MainTopicTwo document's UNID
}
},

To create a label, add a referenceName property to the document properties as shown in the example. The value of the referenceName has the form $UNID:

value where $UNID identifies that the UNID is the value and value is the label or name.

At this time, the UNID is the only document meta-data that can be stored and applied but the mechanism may be extended to support other meta-data information in the future.

To use a label, use the label as an item's data as shown in the second example. The one-touch setup replaces the label placeholder with the value of the label.

Note:
  • referenceName labels are case sensitive.
  • Referenced meta-data (e.g. UNID) are always stored as TYPE_TEXT fields on the document.
  • The document added in the reference label must be created before any other document can reference it.
  • Using an invalid referenceName results in the placeholder value being used as the data of the item.