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:
- property values can be calculated automatically
- properties can be conditionally mandatory or hidden
- document titles can be calculated automatically (in Document Management libraries only)
This article explains how to configure properties to be conditionally mandatory or hidden in the administration interface.
|Configure a formula to make properties conditionally mandatory or hidden|
|Remove conditional logic|
Configure a formula to make properties conditionally mandatory or hidden
2. Create and save a standard custom property, then expand the property to display its full information.
– You must save your custom property before configuring it to be conditionally mandatory or hidden.
– You can't set booleans or properties whose values are calculated to be conditionally mandatory because these properties can never be mandatory.
3. Under Mandatory or Hidden, select the Write formula option, which is available when you press the formula (fx) button.
Tip: Under Hidden, you can select Display property only if mandatory. The formula for this frequent use case is created immediately.
4. Write your formula.
Note: The formula builder is the same for all types of conditional logic. Learn more: What is the formula builder?
You can select the following entities to use in your formula:
- Custom properties from the document:
– in the left panel, select From document > Properties and then press the required type of property, for example, String/Text, Date/Time, Categories
– in the right panel, choose from the properties of the selected type available in your document
- System properties:
– in the left panel, select System properties
– in the right panel, choose the require system property
- Sequence IDs from the document:
– in the left panel, select From document > Sequence ID
– in the right panel, choose the required sequence ID
- Category values from the library:
– in the left panel, select From library > Category values and then press the required category
– in the right panel, choose from the category values defined at the level of the library
- Workflow states from the library
– in the left panel, select From library > Workflow states
– in the right panel, choose the required workflow state
Note: Depending on the document class and library configuration, some entities may not be available. For example, if the document class has no associated workflow, the workflow states section isn't displayed in the formula builder.
Tip: Select Hidden (true or false) or Mandatory (true or false) to insert the code in your formula builder for the frequent use cases of referring to whether the property is mandatory or hidden.
- Getting started with formulas for conditional logic
- Add entity references to your formulas
- What's the difference between category values in properties and category values defined at the library level?
- Handle property values that are empty or that have missing elements
5. Select the required behaviour of the property in the event of a calculation error with your formula.
Fallback behaviour for conditionally mandatory properties:
- Mandatory: the property will be mandatory and users won't be able to save the document until it's filled in
- Optional: the property will be optional and users will be able to save the document without filling it in
Fallback behaviour for conditionally hidden properties:
- Hidden: the property will be hidden and users will be able to save the document
- Visible: the property will be visible and users will be able to enter a value and save the document
Alternatively, you can choose to Keep the calculation error. A warning sign will appear next to the property and users won't be able to save the document until the error is corrected by a library administrator or document manager.
Learn more: Handle errors in conditional logic.
The example below shows a String property "Please specify" which becomes mandatory when the user selects the value "Other" in the property "Billing country".
6. Press OK.
7. Press Save.
Note: When you configure one or more properties to be conditionally mandatory or hidden, any mandatory or hidden settings defined for the creation phase of documents are deactivated.
Tip: To edit your formula after saving, press the left side of the formula tag.
Learn more about how end users use properties that are conditionally mandatory or hidden in their documents: Use conditional logic in your AODocs documents.
Remove conditional logic
To remove the formula that makes properties conditionally mandatory or hidden, press the cross on the formula tag, then confirm.
Any mandatory or hidden settings in place before you configured conditional logic are reapplied to your property, including those defined for the creation phase of documents.