FORMULA LANGUAGE


Accessing data outside the current document and database
Example

The following @functions get data values from a specified database. You cannot set values with these @functions.


The first three parameters are the same for both functions:
For @DbLookup, the fourth parameter is the key, the value to search for in the first sorted column in the view. @DbLookup finds every document that matches the key value. Specify [PartialMatch] in the sixth parameter to match the key against the beginning characters of the column value rather than the entire column value.

For @DbLookup, the fifth parameter is either the name of a field in the database or the number of a column in the view. @DbLookup returns a list of the values in the fields or columns of the found documents. Specify [ReturnDocumentUniqueID] in the sixth parameter to return instead the UNID of the document.

For @DbColumn, the fourth parameter is the number of a column. @DbColumn returns a list of all values in the column.

The following @functions get and set field values in another document in the current database. However, you must know the unique ID of the document.


These functions are suited to accessing and setting values in the parent of a response document, since the unique ID of the parent is in the $Ref field of the child. In documents that have "Formulas inherit values from selected document" set, you can use @InheritedDocumentUniqueID as the formula in a hidden field in the base document, then use that field name as the formula in a hidden field in the inherited document. Otherwise, you must devise a scheme for storing and retrieving the unique IDs of the documents that you want to access.

The following @functions get and set field values in one or more profile documents in the current database. Profile documents are hidden documents used to store information that can then be shared across the database. You can create one profile document per user or one profile document for the entire database.

@GetProfileField retrieves a field from a profile document and caches the field's value for the remainder of the session.

@SetProfileField sets the value of a field in a profile document.

Example
See Also