# 2 Actions: Append term to Genre unless term already exists and distribute terms to fields if not duplicated

**URL:** https://community.mp3tag.de/t/2-actions-append-term-to-genre-unless-term-already-exists-and-distribute-terms-to-fields-if-not-duplicated/59614
**Category:** Support
**Created:** [January 3, 2023, 11:37pm UTC](https://community.mp3tag.de/t/2-actions-append-term-to-genre-unless-term-already-exists-and-distribute-terms-to-fields-if-not-duplicated/59614 "2023-01-03T23:37:22Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![esumsea](https://community.mp3tag.de/user_avatar/community.mp3tag.de/esumsea/32/7219_2.png) [@esumsea](https://community.mp3tag.de/u/esumsea)
#### Post date: [January 4, 2023, 6:51pm UTC](https://community.mp3tag.de/t/2-actions-append-term-to-genre-unless-term-already-exists-and-distribute-terms-to-fields-if-not-duplicated/59614/9 "2023-01-04T18:51:03Z")

</div>

> [@abelcheung](#):
>
> For safety. You won't lose any data in case anything has gone wrong.

OK, sounds like a good plan, if maybe unnecessary, but I guess it is better to be safer than sorry.

I have solved the first issue using this Action:  
Format Value:  
Field: Genre  
Format String: $trim($regexp(%Genre%,'(?:(?\<=/)|(?\<=\A))\s\*([^/]_)\s_/(?=._?(?\<=/)\s_\1(?=/|\Z))',,1))

This will get rid of the duplicates in Genre.  
I got it from here [Merge duplicate words - #10 by dano](https://community.mp3tag.de/t/merge-duplicate-words/16289/10)

I really hope I can figure out how to propagate the specific genres from the Genre field (My second question) as I stupidly erased them after consolidating them in the main Genre field. I will play with abelcheung's suggestion and see if I can get something working.

---

_[View the full topic](https://community.mp3tag.de/t/2-actions-append-term-to-genre-unless-term-already-exists-and-distribute-terms-to-fields-if-not-duplicated/59614)._
