If you want to show or hide an attribute in the form then you must use conditional visibility.
If you want to add more conditions, then write your conditions by using Based on expression option. Here you can use multiple conditions.
https://docs.mendix.com/studio/page-editor-widgets-visibility-section#condition
For document template:
- You can have a Data view and it can retrieve object based on microflow as well: the logic to retrieve the object I will leave it up to you
- You can have an NPE or extend the existing Persistable entity which additional booelans attributes to determine the conditional visibility for a row
- Based on your conditions, set that boolean to true or false
- For document template you can show or hide a row based on condition: for which you must right on the cell or row, then you will see an option like below
- Select the attribute based on which you want to show or hide the row and select appropriate value