# Help with if function

**URL:** https://community.mp3tag.de/t/help-with-if-function/12037
**Category:** Support
**Created:** [May 21, 2011, 2:12pm UTC](https://community.mp3tag.de/t/help-with-if-function/12037 "2011-05-21T14:12:07Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![instigator](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/898d66/32.png) [@instigator](https://community.mp3tag.de/u/instigator)
#### Post date: [May 21, 2011, 2:12pm UTC](https://community.mp3tag.de/t/help-with-if-function/12037/1 "2011-05-21T14:12:07Z")

</div>

Hello.  
How can I do this the next:  
I have in the tag the field "WWW ARTIST" and I want to format it to "WWWARTIST", but only if WWW ARTIST is not empty or missing.  
I appreciate any help.  
Cheers.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [May 21, 2011, 3:55pm UTC](https://community.mp3tag.de/t/help-with-if-function/12037/2 "2011-05-21T15:55:21Z")

</div>

> [@pepe murillo](#):
>
> ... I have in the tag the field "WWW ARTIST" and I want to format it to "WWWARTIST" ...

Begin Action Group **20110521.pepe murillo.WWWARTIST** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field:_ **WWWARTIST**  
_Formatstring:_ **%WWW÷ARTIST%**

 

Action #2  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **WWW÷ARTIST**

 

_Note: Replace each special ÷ character with one space character._  
End Action Group **20110521.pepe murillo.WWWARTIST** (2 Actions)

 

DD.20110521.1957.CEST

---

<div class="post-metadata">

### Author: ![instigator](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/898d66/32.png) [@instigator](https://community.mp3tag.de/u/instigator)
#### Post date: [May 22, 2011, 2:18pm UTC](https://community.mp3tag.de/t/help-with-if-function/12037/3 "2011-05-22T14:18:21Z")

</div>

> [@DetlevD](#):
>
> Action #1  
> _Actiontype 5:_ **Format value**  
> _Field:_ **WWWARTIST**  
> _Formatstring:_ **%WWW÷ARTIST%**
> 
> Action #2  
> _Actiontype 9:_ **Remove fields**  
> _Fields to remove (semicolon separated):_ **WWW÷ARTIST**

Yeah thanks, but as I say before, only do this 2 actions if the "WWW ARTIST" is not empty and exist.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [May 22, 2011, 3:41pm UTC](https://community.mp3tag.de/t/help-with-if-function/12037/4 "2011-05-22T15:41:06Z")

</div>

> [@pepe murillo](#):
>
> Yeah thanks, but as I say before, only do this 2 actions if the "WWW ARTIST" is not empty and exist.

I rely on the miraculous Mp3tag and assume, that this requested optimizing is done by Mp3tag internally ... well ... for action #1 of course ... action #2 will be executed, anyway.

Hmm ... is your intention ... to prevent overwriting resp. removing the possibly existing content in the tag-field WWWARTIST?  
You didn't say that explicitly, but such situation would be the only reasonable background for your request, isn't it so?

Try this ...

Begin Action Group **20110521.pepe murillo.WWWARTIST.1** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field:_ **WWWARTIST**  
_Formatstring:_ **$if2(%WWW÷ARTIST%,%WWWARTIST%)**

 

Action #2  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **WWW÷ARTIST**

 

_Note: Replace each special ÷ character with one space character._  
End Action Group **20110521.pepe murillo.WWWARTIST** (2 Actions)

 

... or maybe this ...

 Begin Action Group **20110521.pepe murillo.WWWARTIST.2** 

Action #1  
_Actiontype 7:_ **Import tag fields (guess values)**  
_Source format:_ **$if2(%WWW÷ARTIST%,%WWWARTIST%)===%DUMMY%**  
_Guessing pattern:_ **%WWWARTIST%===%WWW÷ARTIST%**

 

_Note: Replace each special ÷ character with one space character._  
End Action Group **20110521.pepe murillo.WWWARTIST (1)** (1 Action)

 

DD.20110522.2013.CEST

---

<div class="post-metadata">

### Author: ![JJ\_Johnson](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jj_johnson/32/67_2.png) [@JJ\_Johnson](https://community.mp3tag.de/u/JJ_Johnson)
#### Post date: [May 22, 2011, 6:23pm UTC](https://community.mp3tag.de/t/help-with-if-function/12037/5 "2011-05-22T18:23:20Z")

</div>

I don't understand why this is so complicated. Mp3tag will never create empty fields (and if you set a field to a null string, it will be removed, not left empty). So it's simply:

_Action type:_ **Format value**  
_Field:_ **WWWARTIST**  
_Format string:_ **%www artist%**

---

<div class="post-metadata">

### Author: ![instigator](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/898d66/32.png) [@instigator](https://community.mp3tag.de/u/instigator)
#### Post date: [May 23, 2011, 7:43pm UTC](https://community.mp3tag.de/t/help-with-if-function/12037/6 "2011-05-23T19:43:00Z")

</div>

> [@JJ Johnson](#):
>
> _Action type:_ **Format value**  
> _Field:_ **WWWARTIST**  
> _Format string:_ **%www artist%**

If I do this and the WWW ARTIST is empty or doesn't exist, the WWWARTIST (even if exist) just dissapear. I did the test already.

---

<div class="post-metadata">

### Author: ![JJ\_Johnson](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jj_johnson/32/67_2.png) [@JJ\_Johnson](https://community.mp3tag.de/u/JJ_Johnson)
#### Post date: [May 23, 2011, 10:27pm UTC](https://community.mp3tag.de/t/help-with-if-function/12037/7 "2011-05-23T22:27:43Z")

</div>

> [@pepe murillo](#):
>
> If I do this and the WWW ARTIST is empty or doesn't exist, the WWWARTIST (even if exist) just dissapear.

You failed to mention that WWWARTIST may already exist. You should state the problem completely. In the meantime, maybe you want:

_Action type:_ **Format value**  
_Field:_ **WWWARTIST**  
_Format string:_ **$if2(%www artist%,%wwwartist%)**

---

<div class="post-metadata">

### Author: ![instigator](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/i/898d66/32.png) [@instigator](https://community.mp3tag.de/u/instigator)
#### Post date: [May 24, 2011, 1:02pm UTC](https://community.mp3tag.de/t/help-with-if-function/12037/8 "2011-05-24T13:02:21Z")

</div>

Action #1  
Actiontype 5: Format value  
Field: WWWARTIST  
Formatstring: $if2(%WWW÷ARTIST%,%WWWARTIST%)

THanks, this action do like I want it.

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:23pm UTC](https://community.mp3tag.de/t/help-with-if-function/12037/9 "2026-02-09T12:23:06Z")

</div>


