As a library administrator, you can configure display logic to make custom properties conditionally mandatory or hidden.
Important:
– You can apply display logic to any type of custom property. Learn more: Create and configure custom properties.
– Don't combine display logic with custom scripts.
– Display logic uses the same syntax as calculated properties.
This article explains how to configure properties to be conditionally mandatory or hidden in the administration interface.
Automatically generated table of contents
Configure a formula to make properties conditionally mandatory or hidden
1. Access the document class settings in the library administration.
2. Create and save a standard custom property, then expand the property to display its full information.
Notes:
– 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 click 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 click 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 click 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.
Learn more:
- 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. Click OK.
7. Click 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, click 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, click 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.