Docs
Using the conditional
Another powerful widget in the Blockbax platform is the conditional. The conditional widget allows you to create a container whose content will be shown or hidden based on a configured condition. To use the conditional, navigate to a subject dashboard and add a panel, a conditional requires the context of a subject because the defined conditions will be stored in properties. For the example below, we have two sensors with a property named ‘Has Outdoor temperature sensor", one of the subjects has populated this value with ‘TRUE’ and the other ‘FALSE’. The goal of this How-to is to create a conditional that shows the contents when the property value is ‘TRUE’ and hidden otherwise.
1. Navigate to your subject's dashboard, in our case we will navigate to the subject T-001A.
2. Enter Edit mode.
3. Click "Add panel"
4. Click to add a Conditional.
5. Click "Next step"
6. Select the property that you would like to base your conditional off. In our case, we will use the "Has Outdoor Temperature Sensor" property.
7. Select the property value you would like to use to determine the visibility of the Conditional.
8. Click "Add panel"
9. To resize a panel, you can grab the outer right side of the Conditional container.
10. Click on the top to drag and move the Conditional.
11. If you would like to add panels inside the Conditional, make sure you use the "Add panel" button in the conditional.
12. Add a new panel to your Conditional. We will add a Line chart.
13. Click "Next step"
14. Select Measurements as the data to display and click "Next step".
15. Select your metric, in our case we will display a linechart of the Outdoor temperature when the conditions are met.
16. Click "Render measurement statistics below chart"
17. Click "Add panel"
18. Click the bottom right of the newly created Line chart to resize the height and width of the chart.
19. The conditional has been configured. As you can see above, the property "has Outdoor Temperature Sensor" is set to "True" for this subject, and thus we are able to see the content of the conditional.
20. Below is a screenshot of a subject where the value of "has Outdoor Temperature Sensor" is false, and thus you are able to see that the conditional content is hidden.