Add entity references to your formulas

With AODocs, you can set up conditional logic in document classes in any type of AODocs library. When users edit their documents, conditional logic is applied as follows:

Conditional logic is calculated using formulas that can include references to other entities such as custom or system properties, custom property states (mandatory or hidden) and the document title. 

Before you use this article, you should:

This article explains the syntax of the entity references you can add to your formulas when you configure conditional logic. Use this article alongside the article Getting started with formulas for conditional logic 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 conditional logic:


Learn about entity references:

Automatically generated table of contents


References to entities issued from the document

Custom properties

Custom property values

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

propertyType`Name of your property`

For example:

  • String property value: propertyString`Project Name`
  • Category property value: propertyCategory`Country`

Notes:
– The name of the property you use in your formula is case sensitive.
– If a custom property has one or more backquotes ( ` ) in its name, it can still be referenced from a formula by escaping the backquotes with backslashes ( \ ). For example:
PropertyType`List \`1\``.

You can add this syntax manually to your formula or select properties in the formula builder. Learn more: What can I use in my formula?

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

Custom property states (mandatory or hidden)

In the formula to make your property conditionally mandatory or hidden, you can reference whether another custom property is mandatory or hidden using this syntax:

propertySettings`other custom property`.mandatory

propertySettings`other custom property`.hidden

A few rules apply:

  • This syntax is only available in formulas to make properties conditionally mandatory or hidden and not in formulas to calculate property values or titles.

  • In the formula to make your property conditionally mandatory or hidden, you can't reference as mandatory any properties with calculated values because these properties are never filled in by users. In this case, the Mandatory (true or false) option isn't available in the menu.

  • In the formula to make your property conditionally mandatory or hidden, you can't reference whether the current property is hidden, whereas you can reference whether it is mandatory.

image01.png

You can add this syntax manually to your formula or select properties in the formula builder. Learn more: What can I use in my formula?

System properties

References to system properties in your formula have this syntax.

  • Document title
systemPropertyString`title`
  • Document ID
systemPropertyString`id`
  • Document workflow state ID
systemPropertyString`stateId`
  • Document creation date
systemPropertyDateTime`creationDate`
  • Document state change date
systemPropertyDateTime`stateChangeDate`

 

You can add this syntax manually to your formula or select properties in the formula builder. 

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
systemPropertyString`currentVersionName`
  • Current version creation date
    Type: Epoch milliseconds 
systemPropertyDateTime`currentVersionCreationDate`
  • Current version description
    Type: String
systemPropertyString`currentVersionDescription`


You can add this syntax manually to your formula or select current document version properties in the formula builder. 

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. 

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

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 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:

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

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

6 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
  • Hi,
    is there a way to access Document Description panel via Javascript?

    0
    Comment actions Permalink
  • Hi Emanuele,
    For now it's not possible to "calculate" the rich text "Description". Would you need to calculate a rich format, or only filling it with basic text without formatting would be enough? Could you give us details about your use case in the Feature Request section of the community?
    Thanks a lot!
    Marine, from the AODocs Product Management team

    0
    Comment actions Permalink

Please sign in to leave a comment.