# IF "Albumartist" IS "", "Albumartist" = "Artist"

**URL:** <https://community.mp3tag.de/t/if-albumartist-is-albumartist-artist/18018>\
**Category:** Support\
**Created:** [June 6, 2016, 10:01pm UTC](https://community.mp3tag.de/t/if-albumartist-is-albumartist-artist/18018 "2016-06-06T22:01:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Finu96](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/34f0e0/32.png) [@Finu96](https://community.mp3tag.de/u/Finu96)\
**Post date:** [June 6, 2016, 10:01pm UTC](https://community.mp3tag.de/t/if-albumartist-is-albumartist-artist/18018/1 "2016-06-06T22:01:00Z")

</div>

Hi!

Is there any way to name the TAG "Albumartist" the same as the TAG "Artist" only IF the TAG "Albumartist" is empty?

I'm on a death end since the REGEX action doesnt work with other tags outside of the one you are working with..or at least i think it doesnt

Thanks once again for your time!

---

<div class="post-metadata">

**Author:** ![Rijkstra](https://community.mp3tag.de/user_avatar/community.mp3tag.de/rijkstra/32/22_2.png) [@Rijkstra](https://community.mp3tag.de/u/Rijkstra)\
**Post date:** [June 6, 2016, 11:32pm UTC](https://community.mp3tag.de/t/if-albumartist-is-albumartist-artist/18018/2 "2016-06-06T23:32:24Z")

</div>

This function will test ALBUMARTIST before executing the replacement:

$iflonger(a,b,x,y) if string a is longer than number b, x is returned, otherwise y.

_Action type:_ **Format value**  
_Field:_ **ALBUMARTIST**  
_Formatstring:_ **$iflonger(%albumartist%,0,%albumartist%,%artist%)**

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [June 7, 2016, 3:37am UTC](https://community.mp3tag.de/t/if-albumartist-is-albumartist-artist/18018/3 "2016-06-07T03:37:34Z")

</div>

> [@Finu](#):
>
> ...only IF the TAG "Albumartist" is empty?  
> ...

As this will probably only happen a few times in the life of a file: why don't you filter for these files?  
e.g.  
ALBUMARTIST MISSING  
You could then apply a simple "Format value" action for ALBUMARTIST with the  
Format string: %artist%  
to these files.

---

<div class="post-metadata">

**Author:** ![Finu96](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/f/34f0e0/32.png) [@Finu96](https://community.mp3tag.de/u/Finu96)\
**Post date:** [June 7, 2016, 6:11am UTC](https://community.mp3tag.de/t/if-albumartist-is-albumartist-artist/18018/4 "2016-06-07T06:11:47Z")

</div>

> [@Rijkstra](#):
>
> This function will test ALBUMARTIST before executing the replacement:
> 
> $iflonger(a,b,x,y) if string a is longer than number b, x is returned, otherwise y.
> 
> _Action type:_ **Format value**  
> _Field:_ **ALBUMARTIST**  
> _Formatstring:_ **$iflonger(%albumartist%,0,%albumartist%,%artist%)**

Thank You!!!!! Is there a file or book or anything that has all this funtions explained, or at least listed so i can learn a bit from there? And leave you in peace

---

<div class="post-metadata">

**Author:** ![Rijkstra](https://community.mp3tag.de/user_avatar/community.mp3tag.de/rijkstra/32/22_2.png) [@Rijkstra](https://community.mp3tag.de/u/Rijkstra)\
**Post date:** [June 7, 2016, 6:33am UTC](https://community.mp3tag.de/t/if-albumartist-is-albumartist-artist/18018/5 "2016-06-07T06:33:28Z")

</div>

> [@Finu](#):
>
> Thank You!!!!! Is there a file or book or anything that has all this funtions explained, or at least listed so i can learn a bit from there? And leave you in peace

You can get to the full help document with F1 inside Mp3Tag. Then click on "Scripting." You might also want to look at "Actions."

---

<div class="post-metadata">

**Author:** ![Rijkstra](https://community.mp3tag.de/user_avatar/community.mp3tag.de/rijkstra/32/22_2.png) [@Rijkstra](https://community.mp3tag.de/u/Rijkstra)\
**Post date:** [June 7, 2016, 3:39pm UTC](https://community.mp3tag.de/t/if-albumartist-is-albumartist-artist/18018/6 "2016-06-07T15:39:53Z")

</div>

> [@ohrenkino](#):
>
> As this will probably only happen a few times in the life of a file: why don't you filter for these files?  
> e.g.  
> ALBUMARTIST MISSING  
> You could then apply a simple "Format value" action for ALBUMARTIST with the  
> Format string: %artist%  
> to these files.

Wouldn't it be nice if an action could include a filter somewhat like a WHERE clause. I believe more people would use filters if they didn't have to be set up separately. Do you know if this idea has been discussed before?

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [June 7, 2016, 4:04pm UTC](https://community.mp3tag.de/t/if-albumartist-is-albumartist-artist/18018/7 "2016-06-07T16:04:48Z")

</div>

> [@Rijkstra](#):
>
> ... Do you know if this idea has been discussed before?

AFAIK it has not been discussed before.  
Perhaps, because everything is already there.  
You have the filter which is pretty straightforward to apply.  
You have the actions with a command language to cater for such restrictions.

You are more flexible if you stay modular and separate the retrieval and the editing from each other.  
Otherwise you have to write a separate action for each "where" clause.  
Or you have to open and edit the "where" clause which probably takes just as long as entering the filter.  
Also, it may be puzzling that - with a "where" cluase in one of the actions - only some files get treated as you did not remember the restriction. The filter is more transparent in my opinion.

---

<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:** [June 9, 2016, 9:26am UTC](https://community.mp3tag.de/t/if-albumartist-is-albumartist-artist/18018/8 "2016-06-09T09:26:26Z")

</div>

> [@Finu](#):
>
> ... Is there any way to name the TAG "Albumartist" the same as the TAG "Artist" only IF the TAG "Albumartist" is empty? ...

Beside the other proposals within this thread there is one more here ...

**Action "Format value" Field: ALBUMARTIST Formatstring: $if2(%ALBUMARTIST%,%ARTIST%)**

DD.20160709.1326.CEST

---

<div class="post-metadata">

**Author:** ![Rijkstra](https://community.mp3tag.de/user_avatar/community.mp3tag.de/rijkstra/32/22_2.png) [@Rijkstra](https://community.mp3tag.de/u/Rijkstra)\
**Post date:** [June 9, 2016, 4:17pm UTC](https://community.mp3tag.de/t/if-albumartist-is-albumartist-artist/18018/9 "2016-06-09T16:17:37Z")

</div>

> [@DetlevD](#):
>
> Beside the other proposals within this thread there is one more here ...
> 
> **Action "Format value" Field: ALBUMARTIST Formatstring: $if2(%ALBUMARTIST%,%ARTIST%)**
> 
> DD.20160709.1326.CEST

Good to know! It's counter-intuitive to think that a string can have a T/F value!

---

<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:26pm UTC](https://community.mp3tag.de/t/if-albumartist-is-albumartist-artist/18018/10 "2026-02-09T12:26:17Z")

</div>


