Calculated properties: add entity references to your formulas

Calculated properties are custom properties whose values are calculated from a formula. The formula can include references to other properties, thereby creating dependencies between your properties. Library administrators can create calculated properties for all property types and in all types of library.

Before you use this article, you should:

This article explains the syntax of the entity references you can add to your formulas when you create calculated properties. Use this article alongside the article Getting started with formulas for calculated properties to build simple formulas with copied code snippets. You can also use this article for reference when building your own formulas from scratch.

Note: Learn more about the known limitations and restrictions for calculated properties.

References to entities issued from the document
          Custom properties
          System properties
          Sequence IDs
References to entities issued from the library
           Category values defined at the library level
          Difference between category values in properties and category values defined at the library level
          Workflow states

References to entities issued from the document

Custom properties

References to custom properties (including Category properties) in your formula have this syntax:

property`Name of your property`

For example:

  • String category: property`Project Name`
  • Category property: property`Country`

Note: The name of the property you use in your formula is case sensitive.

You can add this syntax manually to your formula or select properties in the formula builder. Learn more: Create and configure calculated properties.

Example of a coded use case: Calculate a duration between two dates.

System properties

References to system properties in your formula have this syntax.

  • Document title
systemProperty`title`
  • Document ID
systemProperty`id`
  • Document workflow state ID
systemProperty`stateID`
  • Document creation date
systemProperty`creationDate`
  • Document state change date
systemProperty`stateChangeDate`


You must add this syntax manually to your formula. You can't currently select system properties in the formula builder.

Example of a coded use case: Create a document sequence ID with a fixed prefix.

Sequence IDs

Learn more: What is the sequence ID?

References to sequence IDs in your formula have this syntax.

  • Library sequence ID
sequenceId`library`
  • Document class sequence ID
sequenceId`class`
  • Document sequence ID
sequenceId`document`


You can add this syntax manually to your formula or select sequence IDs in the formula builder. Learn more: Create and configure calculated properties.

Example of a coded use case: Create a sequence ID for all documents in a document class.


References to entities issued from the library

Category values defined at the library level

References to category values defined at the library level include the ID of the category and the ID of the value itself:

'#{categoryValue:S00k7ov0000015CI9j/S00kAZb000000qixtA}'

Where:

  • the first ID (S00k7ov0000015CI9j) is the category ID
  • the second ID (S00kAZb000000qixtA) is the category value ID

References to category values use IDs rather than the name of the category value because any given category value is not necessarily unique in a category; it’s only unique at a given level within a given category.

Within the same library, a given category value can be used in:

  • several categories – for example, "France" may be a value of the "Country" and "Market" categories
  • in several levels in multi-level categories – for example, "London" may exist as at both the "Region" and "Town" levels in the category hierarchy "Country/Region/Town"

Difference between category values in properties and category values defined at the library level

Category values in documents refer to the specific values of Category type properties in your document. These category values can change, depending on the value selected by users in your document. Learn more: Edit categories.

In contrast, category values defined at the library level are constants. Categories are defined at the library level and contain a set list of values. Learn more: Create categories.

When do you use category values in documents?

Use these category values when you need to add to your formula the value of a Category type property defined in a document. When the formula runs, the current value defined in your document is used. For example: Create a document sequence ID with a prefix issued from a Category property.

When do you use category values defined at the library level?

Use these category values when you need to add to your formula a reference to a "constant" category value defined in the category configuration of your library. In this case, you reference a specific value in your formula, it doesn’t depend on the values defined in documents.

Workflow states

References to workflow states in your formula have this syntax:

state`Workflow state name`

For example: state`Published`

Note: The name of the workflow state you use in your formula is case sensitive.

You must add this syntax manually to your formula. You can't currently select workflow states in the formula builder.

Example of a coded use case: Use workflow states in calculated properties.

Was this article helpful? 2 out of 2 found this helpful
If you didn’t find what you were looking for, don’t hesitate to leave a comment!
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.