Support,
We are growing our solution to have multiple fleets, and I’m interested in taking one my dashboards that currently has a “Device” context variable, and adding a second context variable that dictates the “Fleet”. The “Fleet” variable is working as expected, but I’d like the ‘Device’ variable to filter down to only devices in the selected fleet.
The attached was my approach, but doesn’t yield the expected results. Instead, once the ‘Fleet’ is selected, only the default value is in displayed in the ‘Device’ dropdown.
Feels like an easy solution, but I just haven’t figured it out yet. This can be done as easily as I’m supposing, right?
What you’re trying to do there - resolve the value of one context variable in the validation rules of another context variable - is not supported. In your screenshot, you’d be matching against the literal characters {{ctx.fleet.value}}
for the value of the fleet
device tag.
Assuming the goal here is to ensure that any deviceId-0
value is a device that is associated with the value passed for the fleet
variable, you could approach this a couple different ways …
- Per block that displays data for the
{{ctx.deviceId-0}}
device, you can change the segment(s) to use an advanced query to match ALL of the following …
- id === {{ctx.deviceId-0}}
- tags === fleet={{ctx.fleet.value}}
- Create a workflow to serve the experience page that renders the dashboard and do the verification there. The easiest way would be to use a Device: Get Node that returns a device using the same advanced query as above (swapping out the
{{ctx}}
variables for however they’re being passed through the request). If no device is found, return an error page instead of the dashboard page.
There are also questions around …
- Are you trying to retrieve devices tagged with that fleet name specifically, or are you trying to retrieve devices associated with a given experience group (which, in a hierarchical group structure, is not necessarily the same thing)?
- Do you have safeguards in place to ensure that a user from Group A is not able to request a device / devices from Group B?