Author Topic: Virtual tag formula for checking custom tag?  (Read 1538 times)

Alumni

  • Sr. Member
  • ****
  • Posts: 1007
Maybe someone with more syntax experience can help me out. I'm trying to create the following virtual tag - display the contents of a custom tag, unless the tag's value is x, in which case nothing will be displayed.

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
I think this should work:
$If($IsMatch(<Custom1>,"x"),,<Custom1>)

And you could add something that might make it more solid for some uses:
Suppose the 'x' from your example is 'jazz'.
And you want to have your virtual tag shown empty only when the custom tag contains only and exactly 'jazz', but you do want to display the contents of the custom tag if it contains 'jazz rock' or 'acid jazz'.

Then you could use:
$If($IsMatch(<Custom1>,"^jazz$"),,<Custom1>)
Last Edit: August 08, 2016, 02:09:14 PM by hiccup

Alumni

  • Sr. Member
  • ****
  • Posts: 1007
Thanks hiccup, that did the trick. Do you know if it's also possible to use $IsMatch with more than one expression? For instance, if custom tag 1 has value x or y, display nothing.

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
Yes, than it would be something like:

$If($Or($IsMatch(<Custom1>,"x")=T,$IsMatch(<Custom1>,"y")=T),,<Custom1>)

(or you can replace "x" with "^x$", see the edit I made to my earlier reply)