# Problem with multi value fields

**URL:** https://community.mp3tag.de/t/problem-with-multi-value-fields/66091
**Category:** Mac
**Created:** [September 28, 2024, 10:51pm UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091 "2024-09-28T22:51:35Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![psweetie11](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@psweetie11](https://community.mp3tag.de/u/psweetie11)
#### Post date: [September 28, 2024, 10:51pm UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/1 "2024-09-28T22:51:35Z")

</div>

Hi  
I have flac files and mp3tag has been working well. I have one use case where I have some tracks that have `00\\01` for the TRACKNUMBER field. This is a multi value field but in all other cases I have removed the Disctoal element. In these use cases, the 00 is the DISCNUMBER and the 01 is the TRACKNUMBER. I only want the latter. I have tried the tag field format using the regex expression `$regex(%trackname%,^.*\\(.*)$,$1)` but it consistently returns the first number (00) NOT the second number (01). I have tried various other cpommands also including meta() and all of them refuse to show me the second number which is the one I want. I have checked using a filter if the field is multi value and it is, not sure why either?

---

<div class="post-metadata">

### Author: ![Doug\_Mackie](https://community.mp3tag.de/user_avatar/community.mp3tag.de/doug_mackie/32/279_2.png) [@Doug\_Mackie](https://community.mp3tag.de/u/Doug_Mackie)
#### Post date: [September 29, 2024, 3:15am UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/2 "2024-09-29T03:15:46Z")

</div>

You could simplify this operation. I see that you are using custom fields. I suggest numbering via Mp3tag's standard field TRACK initially. Use the [Auto-numbering Wizard](https://docs.mp3tag.de/converters/auto-numbering/) to fill that field, one CD at a time.

Just make sure that the sort order of your TRACKNUMBER column matches the order that you want before running the Wizard on each group of files.

After that you could simply copy over the new track numbers into your TRACKNUMBER fields by using a **Format Value** action (see screenshot below)

![FormatValue TrackNum](https://community.mp3tag.de/uploads/default/original/3X/0/4/04015a0c126063b9a121e6f1c05a3c85821a5672.jpeg)

---

<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: [September 29, 2024, 6:11am UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/3 "2024-09-29T06:11:55Z")

</div>

> [@psweetie11](#):
>
> I have tried various other cpommands also including meta()

Try  
`$meta(track,1)` to address the 2nd value.  
`$meta(track,0)` addresses the 1st..

---

<div class="post-metadata">

### Author: ![psweetie11](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@psweetie11](https://community.mp3tag.de/u/psweetie11)
#### Post date: [September 29, 2024, 6:57am UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/4 "2024-09-29T06:57:38Z")

</div>

Thank you. Will try that. The fields are actually mapped and populated generally by power amp whilst ripping. That works fine. These odd cases are using a different music source which Pilates things differently

---

<div class="post-metadata">

### Author: ![psweetie11](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@psweetie11](https://community.mp3tag.de/u/psweetie11)
#### Post date: [September 29, 2024, 6:59am UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/5 "2024-09-29T06:59:44Z")

</div>

Tried that. Off I use `00\\01` rather than the %tracknumber% it works. Doesn’t with the variable for some reason

---

<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: [September 29, 2024, 7:29am UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/6 "2024-09-29T07:29:39Z")

</div>

Mysterious.  
Could you show us a screenshot of the the extended tags dialogue?  
And perhaps of the Options\>Mapping?

---

<div class="post-metadata">

### Author: ![psweetie11](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@psweetie11](https://community.mp3tag.de/u/psweetie11)
#### Post date: [September 29, 2024, 1:57pm UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/7 "2024-09-29T13:57:08Z")

</div>

Showing an example of the data in the main screen  
 ![Screen Shot 2024-09-29 at 14.47.57 pm](https://community.mp3tag.de/uploads/default/original/3X/e/d/edb99da1b19a282232c32283e52d0cf69e56e9a8.png)

The display list is defined as follows which works ok  
 ![Screen Shot 2024-09-29 at 14.52.11 pm](https://community.mp3tag.de/uploads/default/original/3X/9/3/935c00cf89680e6921b86520e541d9938381e529.png)

Showing picture of track. Extended tags shows that it is correctly showing two Tracknumber fields

 ![Screen Shot 2024-09-29 at 14.45.55 pm](https://community.mp3tag.de/uploads/default/original/3X/9/3/933197c5df01c12ae2ed6f5d9a701b82b886ec1f.png)

BUT `$regexp(%tracknumber%,^.*\\(.*)$,$1)` still comes up with 01 in this case NOT the second group which is what I expect. And meta(x,y) seems to always pull out the first group too . . .

The mappings are made in dbpoweramp so that it writes into Tracknumber and Discnumber, so no extra mappings in mp3tag . . .

---

<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: [September 29, 2024, 2:10pm UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/8 "2024-09-29T14:10:49Z")

</div>

> [@psweetie11](#):
>
> `$regexp(%tracknumber%,^.*\\(.*)$,$1)`

AFAIK you can not expect that the multi value field TRACKNUMBER shows `01\\02` by default.  
This is the assumption for your regular expression.

If you want to extract `02` in your example with your regular expression, you could try it with:  
`$regexp($meta_sep(tracknumber,\\\\),^.*\\(.*)$,$1)`  
or as @ohrenkino wrote:  
`$meta(tracknumber,1)`

---

<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: [September 29, 2024, 2:56pm UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/9 "2024-09-29T14:56:05Z")

</div>

... apparently, you created a field called %TRACKNUMBER and not TRACKNUMBER ... but that is a different problem.

If you have multi-value fields and you want to treat them as 1 field, you first have to merge them either with an action or use $metasep() befory you can apply other functions on the whole string.

> [@psweetie11](#):
>
> so no extra mappings in mp3tag

![grafik](https://community.mp3tag.de/uploads/default/original/3X/a/8/a8069664645fcb74306f8b55c02bad4edd8cb8b1.png)  
This is what the mapping looks like in my configuration.

> [@psweetie11](#):
>
> BUT `$regexp(%tracknumber%,^.*\\(.*)$,$1)` still comes up with 01 in this case NOT the second group which is what I expect

Yes, that returns the original contents of the first instance of TRACKNUMBER as the regular expression doesn't find a match ...  
Please try $meta(tracknumber,0) and $meta(tracknumber,1) in the preview of Convert\>Tag-Tag - that is a good test bench to see the results of scripting functions.  
Just a test on an MP3 file with 2 track numbers:  
 ![grafik](https://community.mp3tag.de/uploads/default/original/3X/7/8/78aecd1e990e83138e922bcb511b2b04ed7e316d.png)  
and the preview in Convert\>Tag-Tag:  
 ![grafik](https://community.mp3tag.de/uploads/default/original/3X/3/a/3a7403575e5cd1a1d42aa084903ab8343b2a8743.png)  
... as expected.

---

<div class="post-metadata">

### Author: ![psweetie11](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@psweetie11](https://community.mp3tag.de/u/psweetie11)
#### Post date: [September 29, 2024, 3:23pm UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/10 "2024-09-29T15:23:38Z")

</div>

Mmmmm. I did try both of those and it still returned first pair. If I used “`01\\02`” it worked. I also tried the metasep function and that didn’t help either. Will fiddle again. Thanks for the suggestions

---

<div class="post-metadata">

### Author: ![psweetie11](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@psweetie11](https://community.mp3tag.de/u/psweetie11)
#### Post date: [September 29, 2024, 4:07pm UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/11 "2024-09-29T16:07:23Z")

</div>

Nope def doesn't work. The two TRACKNUMBER fields exist. If I use $meta(%tracknumber%,0) I get NULL, same if I go for the second entry by using 1. Weird. As I said the regex or expression works if I put text instead of the variable name but something is coming through wrong. I am using the Mac version if that has any significance . . .

---

<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: [September 29, 2024, 4:07pm UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/12 "2024-09-29T16:07:36Z")

</div>

Now screenshots of corresponding tests on your side would be nice

---

<div class="post-metadata">

### Author: ![psweetie11](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@psweetie11](https://community.mp3tag.de/u/psweetie11)
#### Post date: [September 29, 2024, 6:03pm UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/13 "2024-09-29T18:03:51Z")

</div>

> [@ohrenkino](#):
>
> $meta(tracknumber,0)

it works in the convert tag-tag test you suggested but returns zero in the action using the same function and has deleted both TRACKNUMBER instances

---

<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: [September 29, 2024, 6:08pm UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/14 "2024-09-29T18:08:24Z")

</div>

> [@psweetie11](#):
>
> but returns zero in the action using the same function

Could you show a screenshot of the function that you used, please?

---

<div class="post-metadata">

### Author: ![psweetie11](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@psweetie11](https://community.mp3tag.de/u/psweetie11)
#### Post date: [September 29, 2024, 6:31pm UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/15 "2024-09-29T18:31:54Z")

</div>

The two functions I used are shown below:

![Screen Shot 2024-09-29 at 19.30.45 pm](https://community.mp3tag.de/uploads/default/original/3X/e/5/e5b3508e637275b62ad31a8915e3b8f899b1da00.png)

![Screen Shot 2024-09-29 at 19.31.01 pm](https://community.mp3tag.de/uploads/default/original/3X/e/b/ebb68ab7d2a2b9a6dac92c9099ba44fe101d1005.png)

---

<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: [September 29, 2024, 6:37pm UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/16 "2024-09-29T18:37:33Z")

</div>

To make $regexp() evaluate all the TRACKNUMBER instances, use

`$regexp($metasep(tracknumber,\\),^.*\\(.*)$,$1)`  
... but this should yield the same result as `$meta(tracknumber,1)`

---

<div class="post-metadata">

### Author: ![psweetie11](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@psweetie11](https://community.mp3tag.de/u/psweetie11)
#### Post date: [September 29, 2024, 6:47pm UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/17 "2024-09-29T18:47:48Z")

</div>

> [@ohrenkino](#):
>
> regexp($metasep(tracknumber,\),^._\(._)$,$1)

nope. should work but doesn't. Same as the meta function. Just deletes them. Very odd as thet work in the concert side

---

<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: [September 29, 2024, 6:50pm UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/18 "2024-09-29T18:50:21Z")

</div>

Try it in Convert\>Tag-Tag and then copy the working string to an action of the type "Format tag field".

---

<div class="post-metadata">

### Author: ![psweetie11](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/db5fbb/32.png) [@psweetie11](https://community.mp3tag.de/u/psweetie11)
#### Post date: [September 29, 2024, 10:08pm UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/19 "2024-09-29T22:08:55Z")

</div>

ok working now. i was picking up the tracknumber kin the expression from the pick list which effectively added the % around it. If you remove them it all works fine. Thank you for your persistence!!

---

<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: [September 30, 2024, 5:17am UTC](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091/20 "2024-09-30T05:17:56Z")

</div>

> [@psweetie11](#):
>
> effectively added the % around it

That is what I said:

> [@ohrenkino](#):
>
> .. apparently, you created a field called %TRACKNUMBER and not TRACKNUMBER ... but that is a different problem.

Reset the field list so that this irregular field gets removed to avoid further problems

[Next page](https://community.mp3tag.de/t/problem-with-multi-value-fields/66091.md?page=2)
