# Format value of split fields

**URL:** <https://community.mp3tag.de/t/format-value-of-split-fields/61062>\
**Category:** Support\
**Created:** [May 25, 2023, 12:23pm UTC](https://community.mp3tag.de/t/format-value-of-split-fields/61062 "2023-05-25T12:23:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rallda](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/bbce88/32.png) [@Rallda](https://community.mp3tag.de/u/Rallda)\
**Post date:** [May 25, 2023, 12:23pm UTC](https://community.mp3tag.de/t/format-value-of-split-fields/61062/1 "2023-05-25T12:23:12Z")

</div>

I am trying to format the field "MOOD" by using the following statement:

> $if2(%MOOD%,%TONES%)

After that I split the field "MOOD" into separate values with another action.

This works fine when the field "MOOD" is empty but if MOOD already contains a value only the first of the MOOD fields is kept.

I have trouble finding a statement that only copies the TONES field to the "MOOD" field when no "MOOD" fields exist (or they are empty) so that existing "MOOD" fields aren't overwritten or removed.

Does anybody know a solution?

---

<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:** [May 25, 2023, 12:32pm UTC](https://community.mp3tag.de/t/format-value-of-split-fields/61062/2 "2023-05-25T12:32:13Z")

</div>

I would not use a $if() function but  
an action of the type "Format value" for MOOD  
Format string: `$meta_sep(mood,\\)\\%tones%`  
The double backslash indicates for MP3tag to create a multi-value field.

---

<div class="post-metadata">

**Author:** ![Rallda](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/bbce88/32.png) [@Rallda](https://community.mp3tag.de/u/Rallda)\
**Post date:** [May 25, 2023, 12:56pm UTC](https://community.mp3tag.de/t/format-value-of-split-fields/61062/3 "2023-05-25T12:56:50Z")

</div>

Thanks for your reply. Your solution works perfectly and combines 2 actions into one so it is more efficient too 😀

---

<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:** [June 24, 2023, 12:57pm UTC](https://community.mp3tag.de/t/format-value-of-split-fields/61062/4 "2023-06-24T12:57:40Z")

</div>

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