# Copying value from a field \*or\* another field to another single field

**URL:** <https://community.mp3tag.de/t/copying-value-from-a-field-or-another-field-to-another-single-field/48090>\
**Category:** Support\
**Created:** [March 5, 2020, 6:31pm UTC](https://community.mp3tag.de/t/copying-value-from-a-field-or-another-field-to-another-single-field/48090 "2020-03-05T18:31:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DJNeidermeyer](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/f08c70/32.png) [@DJNeidermeyer](https://community.mp3tag.de/u/DJNeidermeyer)\
**Post date:** [March 5, 2020, 6:31pm UTC](https://community.mp3tag.de/t/copying-value-from-a-field-or-another-field-to-another-single-field/48090/1 "2020-03-05T18:31:04Z")

</div>

I searched the existing forums and didn't find an answer, and I tried a bunch of boolean stuff and it didn't work.

Recently discovered my CD ripping program has been putting the record label in different fields for mp3s vs. FLACs. I had planned to copy those values into COPYRIGHT with some extra text added on with a custom action. Everything I try to accomplish just ends up swapping empty field value with the occupied field value.

So I'm trying to figure out an action where if the one field value, PUBLISHER, has data it will copy it to COPYRIGHT. If PUBLISHER is empty, then it can be assumed LABEL is not empty, and it will copy LABEL to COPYRIGHT.

My attempt was $if(length(%publisher%=0),%label%,%publisher)

---

<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 5, 2020, 6:47pm UTC](https://community.mp3tag.de/t/copying-value-from-a-field-or-another-field-to-another-single-field/48090/2 "2020-03-05T18:47:17Z")

</div>

> [@DJNeidermeyer](#):
>
> $if(length(%publisher%=0),%label%,%publisher)

This has hardly anything to do with scripting functions in MP3tag.  
See the help:

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

I would like to draw your attention to teh $if2() function.

> [@DJNeidermeyer](#):
>
> If PUBLISHER is empty, then it can be assumed LABEL is not empty, and it will copy LABEL to COPYRIGHT.

This would be broken down to an action of the type "Format value" for PUBLISHER  
Format string: $if2(%publisher%,%label%)

---

<div class="post-metadata">

**Author:** ![DJNeidermeyer](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/f08c70/32.png) [@DJNeidermeyer](https://community.mp3tag.de/u/DJNeidermeyer)\
**Post date:** [March 5, 2020, 7:05pm UTC](https://community.mp3tag.de/t/copying-value-from-a-field-or-another-field-to-another-single-field/48090/3 "2020-03-05T19:05:56Z")

</div>

That worked with the added next step to then FORMAT VALUE %copyright% as %publisher%

So for everyone else reading, the procedure was an Action of two steps:  
Format PUBLISHER with the format string  
Format COPYRIGHT with PUBLISHER

It copies non-empty LABEL into PUBLISHER then copies PUBLISHER into COPYRIGHT

---

<div class="post-metadata">

**Author:** ![DJNeidermeyer](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/f08c70/32.png) [@DJNeidermeyer](https://community.mp3tag.de/u/DJNeidermeyer)\
**Post date:** [March 5, 2020, 7:19pm UTC](https://community.mp3tag.de/t/copying-value-from-a-field-or-another-field-to-another-single-field/48090/4 "2020-03-05T19:19:44Z")

</div>

Actually, I was able to simplify it even more:

Format value: "COPYRIGHT": $if(%label%,%label%,%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:** [April 4, 2020, 7:19pm UTC](https://community.mp3tag.de/t/copying-value-from-a-field-or-another-field-to-another-single-field/48090/5 "2020-04-04T19:19:51Z")

</div>

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