Ensure that the model you want to use has a foreign key property that relates back to the model itself.
Prerequisites
- Open an existing page or create a new one. For example, see our knowledge base article, Add a new page.
Procedure
Add a hierarchical block to your page
- On your page, select ADD CONTENT, and in the Content dialog box, select the Hierarchical block.
- Scroll down, and in the Title box, type in a meaningful name. For example, "Org chart."
- From the Model list, select the model whose data you want to use.
Ensure that the model you want to use has a foreign key property that relates back to the model itself.
- Select SAVE.
Choose your data
Title
- The Title box contains the label shown to users as a filter when the search shows results across multiple models.
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.
Sort data items
If you would like to sort by the property, for example, by the first name. Select the Sort data items option.
- From the Property list, select the property you want to sort by. For example, the first name.
- From the Order list, select to sort by either Ascending or Descending.
- Optionally, add more sorting options.
- Select CONTINUE and proceed to design your hierarchical list. See our knowledge base article, Design your hierarchical list.