Dashboard variables
Dashboard variables allow you to create flexible and reusable dashboards. Instead of being limited to only seeing hard-coding tile objects, variables allow dashboard viewers to switch between objects on the fly. Variables can also be used with shared dashboards.
Getting started
Watch the video below to see how variables work.
Use case examples
The following examples detail some of the ways you can use dashboard variables to your streamline your SquaredUp experience.
Create a template dashboard for pipelines
You could create a dashboard with a variable called Pipeline
, where viewers of the dashboard select the specific pipeline data they are interested in by changing the dashboard variable.
Create a filterable dashboard for microservices
You could create a dashboard with a variable called Service
, where the dashboard displays information about all your microservices by default. Viewers of that dashboard could then filter to a specific microservice by changing the dashboard variable.
Creating variables
Variables are created when in edit mode on a dashboard. You can only create one variable per dashboard at this time.
- Navigate to a dashboard or create a new one.
- Select Edit from the dashboard menu.
- Click Add dashboard variable next to the dashboard title.
- Configure the following settings in the Add dashboard variable window:
- Name:
Enter a name for the variable. For example,Pipeline
. - Objects:
Either select an existing collection or click Add collection to create a new one. The objects in the collection are the possible options for the dashboard variable. - Default value:
Select one of the following:- All objects: The dashboard defaults to selecting the objects in the specified collection whenever the dashboard is loaded.
- None: The dashboard displays no objects when loaded .
When a dashboard with no default is loaded, you're prompted to pick a variable from the dashboard variable dropdown. If only one object exists in the selection, the dashboard will default to it regardless of this setting.
- Allow multiple selection:
Allows the selection of multiple objects in the dashboard variable dropdown. This is enabled by default when Default value is set to All objects but can be manually toggled if the Default value is None.
- Name:
- Click Add. The variable is enabled for the dashboard and the dropdown field displays next to the title.
Using variables in a tile
Once you’ve created a dashboard variable, you can then make use of it in your tiles.
When editing a tile to a dashboard with a variable configured, the dashboard variable dropdown also displays in the tile editor, allowing you to override the available objects.
By default, new tiles inherit their Collection from the dashboard variable.
Configuring a tile with a variable
- Open the tile editor by either:
- Click Edit on a dashboard then click Edit on a tile you want to configure a variable for.
- On your dashboard, click add tile on an empty space then select Data to create a new tile.
- On the Objects tab, when you’re creating a new tile on a dashboard that has a variable configured, the collections are automatically selected for you.
If you are editing a tile that was created before a dashboard variable was configured, you must deselect the current collection and then select the collection with the variable icon
- Continue with the tile configuration as normal.
- Click Save. The tile is now updated automatically whenever you change the variable at the top of your dashboard!
When creating dashboards and tiles it’s possible to enable monitoring or publish the data as a KPI, which runs in the background without needing to view a dashboard.
Because of this, Monitoring and KPI are only available when the dashboard variable has a default value.
This also means that monitoring uses the default value (e.g. all objects) when calculating the latest health state.