I'm iterating through a table with children items and want to take an excerpt of the string in that parameter's value.
I've set the shape data "Parameter" to "5605|ALARM", and put a * in the text to display the full value currently.
I played about with using RegexReplace but I've not gotten the result I'm looking for.
Example parameter value: TS-IP In 11 (My Favourite TS Stream)
Result I want to display to users: My Favourite TS Stream
Please note that it will always be in the above format; TS-IP In xx (Capture Text here), but the xx will either be one or two digits of numbers. If I could just get the first match out of a regex looking inside the brackets that would be good enough, but something a bit more tolerant to account for brackets put in by users would be great. I can do this regex part myself it's just the workflow in Visio I need help with
Hi James,
You should be able to add a shape to your Visio with an expression like this
.* \((.*)\)$
It should work correctly for your use case and discard anything even if () is present.
See:
The final expression would be:
[RegexReplace:[Sep:,#].* \((.*)\)$#TS-IP (In) 11 (My Favourite TS Stream)#$1]
And where I have TS-IP (In) 11 (My Favourite TS Stream) for the example you would place the original value in as a variable or another placeholder.
Hi James,
The wildcard * won’t work in this case.
Could you try something like the following? (without the parameter shape data configured)
[RegexReplace:[Sep:,#].* ((.*))$#[param:*,5605]#$1]
Hi Joao, can you tell me why the * doesn’t work in that case? So I understand going forward.
Also I’ve done that, but it’s not linking to the correct table row of the 5605 parameter, I’ve tried the following too but it results in nothing being shown:
[RegexReplace:[Sep:,#].* ((.*))$#[param:*,5605:[ParentTableIndex]]#$1]
I’ve tried that with and without the parameter shape data field (which I need to set still so that the shape gets the parameter’s alarm colour) it was set to *|ALARM
Correction, the parameter data was previously: 5605|ALARM
If I recall correctly when having the * in the shape to be used as a placeholder for the shape data resolution, the order in which the steps are executed does not allow for both actions to be performed.
The shape data expects anything else on the shape other than the * to be static text and the placeholders on the shape itself expect a static expression that can be processed or that is another placeholder to be processed.
Hello Joao, thanks for your help!
I put your example in a text box and it worked perfectly, however I then replaced your example input text with *, hoping that it being inside the # it would still be recognised as the special placeholder it is, but what happens is the full value is shown in the text box.
This is a child of a table, and the ‘parameter’ shape field is set to ‘5605|ALARM’ and I had * in the text box which was being filled by the full input text I showed earlier (TS-IP…). Do I need to handle this outside of the text box and instead in shape data? How do I do that please?
Thanks, James.