# Format Value action deletes multiple fields with same name

**URL:** https://community.mp3tag.de/t/format-value-action-deletes-multiple-fields-with-same-name/44615
**Category:** No Bugs
**Created:** [February 21, 2019, 4:22pm UTC](https://community.mp3tag.de/t/format-value-action-deletes-multiple-fields-with-same-name/44615 "2019-02-21T16:22:44Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [February 23, 2019, 6:08pm UTC](https://community.mp3tag.de/t/format-value-action-deletes-multiple-fields-with-same-name/44615/3 "2019-02-23T18:08:43Z")

</div>

The problem with this action is, that the simple placeholder `%field%` always refers to the first value of a possibly multi-valued field.

So in your case, `$trim(%genre%)` assigns the trimmed first value of the genre field to the genre field.

This probably _worked_TM in some cases in the past, because Mp3tag didn't apply any changes if the first value didn't change. See this entry from the changelog and the related topic for details:

> FIX: action 'Format value' did not apply changes for multi-value fields if first value stayed the same. ([#44428](https://community.mp3tag.de/t/44428))

An option to trim leading and trailing spaces via Format value for multiple values would be

`$regexp($meta_sep(genre,'\\'),'(^|\\\\)\s+|\s+($|\\\\)',$1$2)`

---

_[View the full topic](https://community.mp3tag.de/t/format-value-action-deletes-multiple-fields-with-same-name/44615)._
