# How do I make a condition so that an empty tag is not copied to another tag that already has a value?

**URL:** https://community.mp3tag.de/t/how-do-i-make-a-condition-so-that-an-empty-tag-is-not-copied-to-another-tag-that-already-has-a-value/67136
**Category:** Support
**Created:** [January 13, 2025, 4:57am UTC](https://community.mp3tag.de/t/how-do-i-make-a-condition-so-that-an-empty-tag-is-not-copied-to-another-tag-that-already-has-a-value/67136 "2025-01-13T04:57:21Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![viviancels](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/bbe5ce/32.png) [@viviancels](https://community.mp3tag.de/u/viviancels)
#### Post date: [January 13, 2025, 4:57am UTC](https://community.mp3tag.de/t/how-do-i-make-a-condition-so-that-an-empty-tag-is-not-copied-to-another-tag-that-already-has-a-value/67136/1 "2025-01-13T04:57:21Z")

</div>

For example, one music service has a Label tag, another one has Publisher tag, I want to make two commands: format value: Field:LABEL / Format string:%publisher and Field:PUBLISHER / Format string:%label% Is it possible that the already existing value is not overwritten by emptiness. So that if there is a value in the publisher tag, it is copied to the label tag, and if the publisher tag is empty, it is not copied. And vice versa.

Happy New Year

---

<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: [January 13, 2025, 6:01am UTC](https://community.mp3tag.de/t/how-do-i-make-a-condition-so-that-an-empty-tag-is-not-copied-to-another-tag-that-already-has-a-value/67136/2 "2025-01-13T06:01:26Z")

</div>

You could use an action of the type "Format value" for PUBLISHER  
Format string: `$if2(%publisher%,%label%)`  
and for LABEL  
Format string: `$if2(%label%,%publisher%)`

see also the documentation:

> **[Scripting Functions – Mp3tag Documentation](https://docs.mp3tag.de/scripting/#boolean-functions)**
>
> Documentation on Mp3tag's scripting functions. Mp3tag is the universal Tag Editor.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [January 13, 2025, 7:37am UTC](https://community.mp3tag.de/t/how-do-i-make-a-condition-so-that-an-empty-tag-is-not-copied-to-another-tag-that-already-has-a-value/67136/3 "2025-01-13T07:37:10Z")

</div>

Explanation of the Boolean function `$IF2`  
 ![image](https://community.mp3tag.de/uploads/default/original/3X/e/2/e22cc411cb2bd6c01f4e2d5436c8f54fd395f49a.png)  
for the above example  
`$if2(%publisher%,%label%)`

`IF` the current content of `%publisher%` is empty, then the content of `%label%` will be filled.  
`IF` the current content of `%publisher%` is NOT empty, then the content of `%publisher%` will be filled = target field (PUBLISHER) remains the same. If you would apply it to another target field like ALBUM, then the current content of ALBUM would be overwritten.

If both of the source fields are empty, then the `$if2()` function will return an empty string which will be written to the target field which means that the contents of the target field gets deleted.

---

<div class="post-metadata">

### Author: ![viviancels](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/bbe5ce/32.png) [@viviancels](https://community.mp3tag.de/u/viviancels)
#### Post date: [January 14, 2025, 3:56am UTC](https://community.mp3tag.de/t/how-do-i-make-a-condition-so-that-an-empty-tag-is-not-copied-to-another-tag-that-already-has-a-value/67136/4 "2025-01-14T03:56:10Z")

</div>

Thank you. $if2(%label%,publisher%) need add % before publisher

---

<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 13, 2025, 3:56am UTC](https://community.mp3tag.de/t/how-do-i-make-a-condition-so-that-an-empty-tag-is-not-copied-to-another-tag-that-already-has-a-value/67136/5 "2025-02-13T03:56:53Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
