Prerequisites
- Open an existing page or create a new one. For example, see our knowledge base article, Add a new page.
Procedures
Add a Document viewer block to your page
- On your page, select ADD CONTENT, and in the Content dialog box, select the Document viewer block.
- Scroll down and in the Title box, give your calendar a meaningful name.
- From the Model list, select the model that has the file-type property you want to add.
- Select SAVE.
Configure your document viewer
- The Data source is the model you selected, but you can select a different one here or select the Create a new one link that redirects you to create a new model.
- From the Document file property list, select the file-type property in your model where you're storing your document.
- From the Document title property list, select the property that you want to use as the list item. The user selects this from the list to open the document attached to that record. This image shows a list of names, but you could have a list of months and display payslips.
- To sort the Document title property list items, from the Sort property list, select the property you want to sort by, and from the Sort direction list, select the direction you want to sort your list of documents.
- In the No items text editor, type in the text, you want to appear when there are no items to show.
Filter data items
DO NOT use the filter for access control because users can still access data through other means, for example, APIs. See our knowledge base article, Add an access control policy.
- You can optionally restrict the user's data in this block. Otherwise, select CONTINUE and skip to the next section.
- Select the Filter data items option and under the Filter data items section, choose what you want to do:
- Meet ALL of the following conditions (and) - If you want to hide the selected data when it meets every condition you add, add a condition under this section.
- Meet ANY of the following conditions (or) - If you want to hide the selected data when it meets just one of several conditions, add your conditions under this section.
- From the Property list, select the model's property. The next options vary, depending on the property that you have chosen.
- To pass is the Object ID so that the data is relevant, you can choose the settings:
- Property: "Id"
- Criteria: "is any of"
- Value: "objected"
- For example, you choose the "Id" Property "is any of" the Value "objectId" to only view data based on the signed-in user, or change to "is not any of" to prevent the user from viewing data based on the signed-in user.
- To pass is the Object ID so that the data is relevant, you can choose the settings:
Be careful when selecting properties. You can't use a property with a large amount of text, such as a Description, if any property values exceed the limit for using a property as a filter. You can try to shorten the property values and try the next day again.
- From the Criteria list, select the condition you want the property value to meet to hide the block from the page.
- In the Value box, enter the property's value that you want the condition to meet to hide the block from the page.
- For lookup properties, you can select a lookup option.
- For foreign key properties, you can select any values against the default label property of the linked model. However, if there is nothing to select, there might not be any values for the property.
Hide or show this block using filters
Show or hide this content block when certain conditions are met. For example, show to a manager but hide from a non-manager. You can base these filters on anything, such as job role, department, or location.
- Select the Hide or show this block using filters option.
- Under the Conditions section:
- Hide when ALL of the following conditions are met (and) - If you want to hide this block when the selected data meets every condition you add, add a condition under this section.
- Hide when ANY of the following conditions are met (or) - If you want to hide the block when the selected data meets just one of several conditions, add your conditions under this section.
- From the Property list, select the model's property.
- From the Criteria list, select the condition you want the property value to meet for the block to be hidden.
- In the Value box, enter the property's value you want the condition to meet for the block to be hidden.
- For lookup properties, you can select a lookup option.
- For foreign key properties, you can select any values against the default label property of the linked model. However, if there is nothing to select, there might not be any values for the property.
Finish
Once you have chosen your options, select UPDATE.