# Replacing only when field actually has a value

**URL:** https://community.mp3tag.de/t/replacing-only-when-field-actually-has-a-value/10151
**Category:** Support
**Created:** [March 20, 2010, 8:04pm UTC](https://community.mp3tag.de/t/replacing-only-when-field-actually-has-a-value/10151 "2010-03-20T20:04:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![SB1](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/0ea827/32.png) [@SB1](https://community.mp3tag.de/u/SB1)
#### Post date: [March 20, 2010, 8:04pm UTC](https://community.mp3tag.de/t/replacing-only-when-field-actually-has-a-value/10151/1 "2010-03-20T20:04:49Z")

</div>

Hi I have a question and haven't been able to find an answer in the forums so far.

I use the FORMAT VALUE function to fill BAND with the value of the ARTIST field. However, sometimes ARTIST is blank while BAND is filled. If I execute the replace commando I end up with an empty BAND field.

So my question: How can I let mp3tag replace BAND with ARTIST only when ARTIST actually has a value?

---

<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: [March 20, 2010, 8:59pm UTC](https://community.mp3tag.de/t/replacing-only-when-field-actually-has-a-value/10151/2 "2010-03-20T20:59:15Z")

</div>

> [@SB1](#):
>
> So my question: How can I let mp3tag replace BAND with ARTIST only when ARTIST actually has a value?

I would always apply a filter first and check whether the action will hit the right files.  
So a filter to find all the tracks with empty artists:  
%band% IS "" AND %artist% NOT IS ""

Alternatively you could sort first the %band% column and then the %artist% column which should group all similar files togehter.  
Then select them and start your action.

---

<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: [March 21, 2010, 1:16am UTC](https://community.mp3tag.de/t/replacing-only-when-field-actually-has-a-value/10151/3 "2010-03-21T01:16:57Z")

</div>

Create an action like the following. This will either overwrite BAND with ARTIST if ARTIST exists, or keep the old value unchanged if ARTIST does not.

_Action type:_ **Format value**  
_Field:_ **BAND**  
_Format string:_ **$if2(%artist%,%band%)**

---

<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:22pm UTC](https://community.mp3tag.de/t/replacing-only-when-field-actually-has-a-value/10151/4 "2026-02-09T12:22:15Z")

</div>


