I am trying to modify the displayed name of an element in a visual overview from 'ABC-XYZ' to 'ABC'. The element name is retrieved using the INFO shape data filed and I apply a RegexReplace but this doesnt seem to be working. Any ideas if this is a syntax issue or its currently not supported ?
INFO | [RegexReplace:-*,[ELEMENT NAME],]
INFO | [RegexReplace:(-)*,[ELEMENT NAME],]
Thanks Aston. I believe you are right, the [ELEMENT NAME] placeholder doesnt resolve. I thought it was implied in the help pages although not specifically documented. Also putting the name directly doesnt work. My use-case unfortunatley will not allow me to manupulate from a protocol.
Hi Wale,
With the Info shape data I am not sure if it is possible but adding the expression to the shape text should do what you need.
Additionally, the current regex expressions you are using may result in a slightly different result than the one you are after as you can see below.
The * character in regex behaves like a quantifier which means it will try to find 0 or more occurrences of the - character
Adapting slightly your expression to -.* means that it will look for the - followed by 0 or more occurrences of . (which in the context of regex is a wildcard for any character)
The shapes in Visio
The shapes in DataMiner
The final expression you need to use is
[RegexReplace:-.*,[this element],]Spot on! Joao Thanks. I actually didnt know that manupulating shape text was possible in this manner.
I was able to reproduce the result above on an element visual.
Can I make use of the same on a visual on view level, that uses the element names of different elements? If I get it right the placeholder [this element] does not work in this case, even not, when the shapes are added to a group with the shape data ELEMENT: <elementname>.
I just found a solution by further trial and error:
– create the shape with shape text [RegexReplace:-.*,[ELEMENT NAME],]
– group this shape and give the group the shape data INFO=”ELEMENT NAME”
– group the group again and give the group the shape data ELEMENT=
Hi Wale,
As far as I’m aware the Info (Shape Data) does not handle Placeholders. The second issue I see is that there isn’t [ELEMENT NAME] placeholder documented, so the RegexReplace query would not resolve. I have yet to find a way to display the result from a RegexReplace directly. So my only idea would be to have a parameter in your protocol where you could manipulate the element name via a QAction and display it.