Author Topic: Naming template help: how to say "if tag1, tag2 and tag3 are all null, then do?  (Read 1109 times)

jonap

  • Full Member
  • ***
  • Posts: 129
It's probably a stupid question but I can't seem to make it work

There is $IsNull, and there is $And, but I can't make it work together

$If($And($IsNull(<tag1>),$IsNull(<tag2>),$IsNull(<tag3>)), <do something>)

this would be my attempt, but it doesn't work

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1013
  • Heal The World
This is how I would do it. I think both of these methods do the same thing.

1. $If($And(<tag1>="",<tag2>="",<tag3>=""),do this,do that)

2. $IsNull(<tag1>,$IsNull(<tag2>,$IsNull(<tag3>,do this, do that), do that),do that) (see the post below for a simplified version)

Edit: The "do this" in my examples represents the true value of the statements. The "do that" represents the false part.
         Also have a look here to see how these functions are supposed to work: https://getmusicbee.com/forum/index.php?topic=35868.0
Last Edit: April 25, 2022, 03:53:11 PM by Mayibongwe
Favourite song at the moment:   Decode by Paramore

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
This should work too:
$IsNull(<tag1><tag2><tag3>,do something, do something else)

jonap

  • Full Member
  • ***
  • Posts: 129
thanks guys, they both work (hiccup's and #1 of Mayibongwe )

#2 is not really suitable cause I have a long "do that" and repeating it 3 times would make a mess

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1013
  • Heal The World
Even better. Thanks hiccup.
(On that thread of yours that I linked, the IsNull example appears to be missing a closing tag for album)

@jonap
I agree. The 2nd has been scratched out.
Favourite song at the moment:   Decode by Paramore

hiccup

  • Sr. Member
  • ****
  • Posts: 7781
(On that thread of yours that I linked, the IsNull example appears to be missing a closing tag for album)
Thnx, fixed.