Add entity references to your formulas

With AODocs, you can automatically calculate the following elements in your documents:

Note: Calculated settings are currently in private beta. To request access to the private beta, reach out to us: aodocs-beta@aodocs.com.

These elements can be calculated using formulas that can include references to other elements, thereby creating dependencies between your properties, settings and titles. Library administrators can create calculated elements in any type 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 elements. Use this article alongside the article Getting started with formulas for calculated elements to build simple formulas with copied code snippets. You can also use this article for reference when building your own formulas from scratch.

Advanced users can get creative and write their own formulas for calculated elements:


Learn about entity references:

References to entities issued from the document
          Custom properties
          System properties
          Current document version
          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 elements.

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 can add this syntax manually to your formula or select properties in the formula builder. Learn more: Create and configure calculated elements.

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

Current document version properties

References to current document version properties in your formula have this syntax.

  • Current version name
    Type: String
doc.currentVersion.name
  • Current version creation date
    Type: Epoch milliseconds 
doc.currentVersion.creationDate
  • Current version description
    Type: String
doc.currentVersion.description


You must add this syntax manually to your formula. You can't currently select current version properties in the formula builder. Learn more: Create and configure calculated elements.

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 elements.

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 category name, the value name and the ID of the value:

categoryValue`Document type:Procedure(SDxe5OG000001ptLxh)`

Where:

  • Document type is the Category name
  • (SDxe5OG000001ptLxh) is the category value ID
  • where Procedure is the category value ID

References to category values use the ID in addition to the value name 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 can add this syntax manually to your formula or select workflow states in the formula builder. Learn more: Create and configure calculated elements.

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

Was this article helpful? 3 out of 3 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

4 comments
  • How to extract the version name (the technical property linked to the versioning system) in a metadata ? Since "Version name" is how this system property is called in AODocs, i tried the following formula :

    systemProperty`version name`

    But it's telling me the property is not defined. Is there a syntax I can use to extract this information in a calculated metadata ?

    2
    Comment actions Permalink
  • Looking for the same thing. I want to be able to see the current version number in my document properties.

    1
    Comment actions Permalink
  • Are the only defined system properties limited to "Title", "ID", "State ID", "Creation Date", "State Change Date" mentioned in the article above? Can the "Last Update Date" be used in the formula? If yes, what is the code?

    0
    Comment actions Permalink
  • Hi Siang Leng Sim,

    The system properties accessible in the formula context are indeed limited to the list defined above.

    Following Morgane's and Ray's requests above and discussions with them to clarify their use cases, we will add the "Current version name", "Current version creation date and "Current version description". They will be available in the next version of the product, AODocs V55.

    The "Last update date" is not available. What would be your use case? We are curious to know more about formulas dependent on a value that changes every time the document is updated. Feel free to post the details of your need in the Feature Requests https://support.aodocs.com/hc/en-us/community/topics!

    Marine, from the AODocs Product Management team

    0
    Comment actions Permalink

Please sign in to leave a comment.