In Visio, we are displaying Active alarms one by one using the Children syntax.
We would like to change the background color of the entire row depending on the ELEMENT NAME of the alarm. This is not based on the alarm severity, but rather to highlight specific critical devices.
Is it possible to apply custom coloring to alarms based on the ELEMENT NAME?
Hi Yuki,
There are two ways you can approach this:
The first is by using the BackgroundColor shape data and the [Element Name] placeholder. It is then needed to do some form of lookup between the element name and the color (can be just a color name (e.g. "red") or a another form of defining a color, more info here). If there is a single set of elements you want to highlight, you can just use a RegexReplace like this:
[RegexReplace:VisioQA-Element,[ELEMENT NAME],red]
More info on regexreplace can be found here.
This can however can complex if you for example start nesting these to match multiple sets of elements to multiple colors (the output of this placeholder if it does not match is just the element so you can nest multiple.
A better approach might be to have a dummy element with a table where the PK or DK is the element name and a column represents the color, then you can use the [param] placeholder to query the correct color.
The other approach (worse to maintain but easier if the set of elements is small) is to use conditional display. With the show shape data, you can set if shape should be shown or not. So if you stack multiple shapes on top of each other (one with color and one without for example), you can then use conditional display to only show the one with color for specific elements. This can look like this for example:
[sep:-^]<A>^A|Value|[ELEMENT NAME]|Regex=VisioQA*
This will show this shape for each alarm where the element name starts with VisioQA. Note that the sep placeholder at the start is needed when the Regex or ElementName could contain a "-".
You can stack multiple of these shapes if multiple colors would be needed for multiple sets of elements
Hopefully one of these approaches can help you forward!