Skip to main content

SetIdentifier

Sets the document identifier.

Syntax

expression.SetIdentifier(sIdentifier);

expression - A variable that represents a ApiCore class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sIdentifierRequiredstringThe document identifier.

Returns

This method doesn't return any data.

Example

Assign a unique identifier to the document through its core properties in a document.

// How do I store a custom ID string in a document's metadata in a document?

// Link a document to an external system by embedding its tracking ID in the built-in properties in a document.

const doc = Api.GetDocument();
const core = doc.GetCore();
core.SetIdentifier("#ID42");

const identifier = core.GetIdentifier();
let paragraph = doc.GetElement(0);
paragraph.AddText("Identifier: " + identifier);