@GetDocField (Formula Language)
Given the unique ID of a document, returns the contents of a specific field on that document. The document must reside in the current database.
Syntax
@GetDocField( documentUNID ; fieldName )
Parameters
documentUNID
Text. The unique ID of a document. @DocumentUniqueID specifies the unique id of the current document. To specify the unique id of the parent document, you can use $Ref as the parameter. $Ref is the name of the special field on a response document that stores the unique id of its parent.
fieldName
Text. The name of a field on the document, enclosed in quotation marks. If you store the field name in a variable, omit the quotation marks here.
Return value
fieldValue
Text or text list; number or number list; time-date or time-date range. The contents of the field on the specified document. Returns null if the UNID or field name is invalid.
Usage
This function does not work in column or selection formulas.
Examples
- You have a discussion database with main topics and responses.
In each response, you want to store the subject of the parent document
in a field called OriginalSubject. You want OriginalSubject to change
if the subject of the main topic changes, so you write this formula
for it. $Ref is a special field on a response document that contains
the unique ID of the parent document.
@If(@IsNewDoc; Subject; @GetDocField($Ref; "Subject"))
- The following formula can run a scheduled agent to update the
contents of a child document, based on the parent.
FIELD Project:=@GetDocField($Ref; "Project"); @All
- The following formula runs a scheduled agent to update the contents
of one document based on the content of another. The documents don't
need to be parent and child. For example, these could be two parent
documents or two child documents.
FIELD Body:=@GetDocField("BB791838F30B20ED852567BA0064DDAF"; "Body"); @All