getmusicbee.com

Support => Questions => Topic started by: Alumni on August 08, 2016, 10:25:32 AM

Title: Virtual tag formula for checking custom tag?
Post by: Alumni on August 08, 2016, 10:25:32 AM
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.
Title: Re: Virtual tag formula for checking custom tag?
Post by: hiccup on August 08, 2016, 12:29:16 PM
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>)
Title: Re: Virtual tag formula for checking custom tag?
Post by: Alumni on August 08, 2016, 02:07:10 PM
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.
Title: Re: Virtual tag formula for checking custom tag?
Post by: hiccup on August 08, 2016, 03:48:53 PM
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)
Title: Re: Virtual tag formula for checking custom tag?
Post by: Alumni on August 08, 2016, 04:43:00 PM
Great thanks, that will do nicely.