# Mp3tag version 3.22 - json\_select\_many function

**URL:** https://community.mp3tag.de/t/mp3tag-version-3-22-json-select-many-function/62095
**Category:** Fixed Bugs
**Tags:** bug-fixed
**Created:** [September 10, 2023, 1:00am UTC](https://community.mp3tag.de/t/mp3tag-version-3-22-json-select-many-function/62095 "2023-09-10T01:00:38Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![rboss](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/5f9b8f/32.png) [@rboss](https://community.mp3tag.de/u/rboss)
#### Post date: [September 10, 2023, 1:00am UTC](https://community.mp3tag.de/t/mp3tag-version-3-22-json-select-many-function/62095/1 "2023-09-10T01:00:38Z")

</div>

Hello everyone,

I think there is a bug with version 3.22, on the `json_select_many` function. I'll try to explain in detail:

- using my own script to parse json formatted data from iTunes API, on `[ParserScriptAlbum]` I use `json_select_many` to get the "contentAdvisoryRating" value for each track, which classifies it as explicit or not. It's important to note that the "contentAdvisoryRating" key is only present if that track is considered explicit and absent if it is not. In a simple example, the raw data from the API would be something like:

{"wrapperType":"track", "trackName":"one", "trackNumber":1, "contentAdvisoryRating":"Explicit"},  
{"wrapperType":"track", "trackName":"two", "trackNumber":2},  
{"wrapperType":"track", "trackName":"three", "trackNumber":3},  
{"wrapperType":"track", "trackName":"four", "trackNumber":4, "contentAdvisoryRating":"Explicit"},  
{"wrapperType":"track", "trackName":"five", "trackNumber":5, "contentAdvisoryRating":"Explicit"},

where tracks 1, 4, 5 are explicit and 2, 3 are not. Again, what's important in this example is that in this json array, some elements have the "contentAdvisoryRating" key and some do not.

On version 3.21:  
Using the command **json\_select\_many "results" "contentAdvisoryRating" "|"** the respective output for the above example would be:

output["TAG"]= Explicit | | | Explicit | Explicit

- one "explicit" value followed by a separator " | " a "blank" value followed by a separator " | " another "blank" value followed by a separator " | " one "explicit" value followed by a separator " | " another "explicit" value \>\>\>\>\> this is desired.

On version 3.22:  
The same command on the same data outputs:

output["TAG"]= Explicit | Explicit | Explicit

- one "explicit" value followed by " | " another "explicit" value followed by " | " and another "explicit" value \>\>\>\> this is NOT desired

This is just a simple example that represents the problem as I am able to identify it. From my understanding `json_select_many` is ignoring absent keys instead of assigning 'blank' values to the output. I'm also unsure if other json-related functions are also having troubles.

Can anyone else replicate this problem? Is it a bug?

Thank you.

---

_[View the full topic](https://community.mp3tag.de/t/mp3tag-version-3-22-json-select-many-function/62095)._
