document_metadata (k)

The document_metadata(k) function retrieves the document metadata that has been set by the last template for the key k. Document metadata can be set by assigning values to fields in the built-in _Document Field Set.

If no template has previously been run or if the last template did not set a value for the key k, the document_metadata(k) function returns an empty string.

The document_metadata data is part of the session data and persists over jobs until the next template is run.