# Joining more than one value from an element

**URL:** <https://community.mp3tag.de/t/joining-more-than-one-value-from-an-element/50626>\
**Category:** Web Sources Discussion\
**Created:** [October 29, 2020, 10:00pm UTC](https://community.mp3tag.de/t/joining-more-than-one-value-from-an-element/50626 "2020-10-29T22:00:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [October 29, 2020, 10:00pm UTC](https://community.mp3tag.de/t/joining-more-than-one-value-from-an-element/50626/1 "2020-10-29T22:00:58Z")

</div>

Here's the script. [Beatport by &stevehero v5.0#Search Release\_Joining Question.src](https://community.mp3tag.de/uploads/short-url/ixT2UUDt3ntsGICdqSjxVHHmFRS.src)

I was hoping to join multiple values from elements of the artist array below.

The array is like so:

```auto
"artists": [{
      "id": 25274,
      "name": "Luigi Daniell",
      "slug": "luigi-daniell"
    }, {
      "id": 26182,
      "name": "deadmau5",
      "slug": "deadmau5"
    }]

```

I was after the result like so from the array:

```auto
https://www.beatport.com/artist/deadmau5/26182\\https://www.beatport.com/artist/luigi-daniell/25274

```

I would like to combine and use a separator like the `json_select_many` function to output:

1. [https://www.beatport.com/artist/](https://www.beatport.com/artist/)
2. The `slug` property.
3. A `/` character.
4. The `id` property.

And do this for whatever number of artist elements there are in the array like the result shown above.

**Edit:** I've ended up hacking a new property inside each element.

```auto
regexpreplace "(\"id\":\s+)(\d+)" "$1\"$2\"" # Fix #1 for BEATPORT_ARTIST_URL to quote the id element, IMPORTANT, DO NOT REMOVE!
regexpreplace "(\"id\": \"(\d+)\", )(\"name\": \"[^\"]+\", )(\"slug\": \"([^\"]+)\")" "\"artist_url_stevehero_custom\": \"https://www.beatport.com/artist/$5/$2\", $1$3$4" # Fix #2 for BEATPORT_ARTIST_URL to add a new element for the url, IMPORTANT, DO NOT REMOVE!

```

Then:

```auto
outputto "BEATPORT_ARTIST_URL"
json_select_many "artists" "artist_url_stevehero_custom" "\\u005c\\u005c"
sayrest
say "|"

```
