I want to do some regex on a child element's name, for this example let's say there's a view which is called 'RF cams', and it has child elements which are always called "RF Cam 1", RF Cam 2", etc. There are quite a few and I want the number to be quite large, so I want to cut the 'RF Cam ' part from the displayed name.
If i could use the asterisk in the text box I could work with that, but as I can't (partly because you can't use that with regex as I understand it, and because the asterisk returns blank on this child shape for some reason).
So how can I do this? Currently I'm using "Info" - "Name" and an asterisk to display the name.
Thanks peeps!
You can use regexreplace to make modifications on the displayed name.
Rather than using the Info shape data, we recommend nowadays to use the placeholder in your shape text. That means
- Remove the Info shape data
- Replacing the asterisk '*' in your text with "[Name]" will give you the same result
- You can now wrap the "[Name]" in a regexreplace directly in your shape text. e.g. [regexreplace:RF Cam ,[Name],]
Indeed, it opens up a world of possibilities as you can also use multiple info tags in one shape, where previously you were limited to one.
Hi James,
You can use a placeholder for this, i.e. [this element] resolves also to the name of the element. Maybe it's good to keep in mind that the context of the shape and the context of the placeholder may be different, so it could be that you'll need an extra option to correct this (e.g. ForcePropertyFromShape).
As for the shape, you can remove the Info shape data and replace the text of the shape with the placeholder: [RegexReplace:RF Cam ,[this element],]
Kind Regards,
Jarno
Hi Jarno, [this element] results in a blank output on the object, with and without the ‘Info’ shape data, so that doesn’t work.
I have been using [this element] placeholder in most places, the [name] placeholder passed me by as it’s not directly listed in the placeholders documentation, but now I’ve seen the link to the ‘info’ part at the top, that’s going to be very useful, thanks!