Use conditional logic in your AODocs documents

If your administrator has set up conditional logic in a document class in your library, when you edit your documents conditional logic is applied as follows:

  • property values can be calculated automatically
  • properties can be conditionally mandatory or hidden
  • document titles can be calculated automatically (in Document Management libraries only)

Notes:
– Properties and titles that use conditional logic are read-only. You can't edit them manually.
– Administrators can apply conditional logic to any type of custom property. Learn more:
Create and configure custom properties and Create formulas for conditional logic

This article explains how to use conditional logic in your document editor.

Automatically generated table of contents


Calculate property values automatically

In the example below, the property "Next review date" is calculated from the values of "Issue date" and "Review cycle (months)". When you enter values in these properties, the unsaved calculated property "Next review date" appears with a blue side bar. 

If you quit edit mode without saving, the calculated property value is not saved. However, if you save your document, the calculated property value is saved in your document, like standard property values.

Learn more: Edit custom properties

image01.png


Use conditionally mandatory or hidden properties

In the example below, the property "Please specify" is conditionally mandatory and hidden. If any value except "Other" is defined for the property "Billing country", the property "Please specify" remains hidden. If "Other" is selected for "Billing country", the property "Please specify" is no longer hidden and becomes mandatory. A banner appears, indicating that the mandatory property "Please specify" must be filled in. 

After filling in "Please specify", you can save your document.

image02.png


Calculate document titles automatically

Calculated titles ensure consistent naming conventions for documents in a document class. If calculated titles are configured for a document class in your library, you can't manually edit the titles of your documents in the document class. 

Note: Calculated titles can be configured in Document Management libraries only.

When you create a new document, a message in the title bar indicates that you can't define a title for your document because it's calculated automatically. 

titleimage01.png

In the example below, the title is calculated from the values of the properties "Request ID" and "Reason". When you fill in these properties, you can see the title before you save your document. 

image02.png

Tip: Administrators should ensure properties used to calculate titles are mandatory.


Handle errors in conditional logic

Properties or titles that use conditional logic are recalculated in individual documents when operations are performed on the document, for example when:

  • a user manually saves the document
  • manual or automatic workflow actions are performed
  • the permissions are changed in the document

Note: Documents can also be updated by the application programming interface (API).

The calculation can result in an error if:

  • the result calculated doesn't match the expected property type – in the case of calculated property values
  • an error occurs when calculating the formula for this document

Notes:
– Library administrators can write formulas so empty values are handled correctly and you can save your document. Learn more: Getting started with formulas for conditional logic.
– If a property with a calculated value that results in an error is referenced in another property with a calculated value, the second one will also be in error.

Tip: All users can search for documents that have (or don't have) a calculation error in one or more calculated property values or in their calculated title. They can also display them in views. Learn more:
–  Search for system properties and custom properties
Use views in your AODocs libraries

What happens if there's an error in the conditional logic?

When a document has an error in its conditional logic, manual save is always blocked, except in the case of conditionally mandatory or hidden parameters with a fallback behaviour defined. Learn more: Calculation errors in conditionally mandatory or hidden properties

However, you can still carry out the following operations: 

Below is a description of what happens when you perform one of these operations in a document with a calculation error.

 

Calculation errors in calculated titles

The calculated title becomes Untitled.

Learn more: Configure conditional logic to calculate document titles.

 

Calculation errors in properties with calculated values

The value of the property is empty. The property isn't visible to end users, but library administrators and document managers (learn more: What are roles?) can see the property marked in error when they access the document editor in view mode.

Learn more: Configure conditional logic to calculate property values.

errorimage01.png

 

Calculation errors in conditionally mandatory or hidden properties

If a conditionally mandatory or hidden property has a fallback behaviour set in the event of a calculation error, the property becomes:

  • mandatory or optional (for conditionally mandatory parameters)
  • hidden or visible (for conditionally hidden parameters)

In this case, users can save the document. Learn more about how administrators can configure a fallback value to prevent errors occurring.

Learn more: Configure properties to be conditionally mandatory or hidden.

If a conditionally mandatory or hidden property doesn't have a fallback behaviour set in the event of a calculation error, the calculation error remains and users can't save the document until the error is corrected. If they try to save the document, an error message opens.

image08.png

Library administrators and document managers (learn more: What are roles?) can see the property marked in error when they access the document editor in view mode. They can click the blue warning triangle to view the error message.

image07.png

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