# Transforming a joined list of keys into a joined list of values

**URL:** <https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758>\
**Category:** Ask for Help\
**Created:** [April 19, 2021, 12:34pm UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758 "2021-04-19T12:34:49Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 19, 2021, 12:34pm UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/1 "2021-04-19T12:34:49Z")

</div>

I’m having a mental block with this one.

Imagine I have a table containing “things”. Something like this:

![Screen Shot 2021-04-19 at 8.25.38 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/1/b1b8815c3b6cdfe792393e71a854910c00a6e4e6.png)

In a second table, I have a column that contains a joined list of “keys”. Like so:

`1,2,1,1,1,3,4,2,3,2,2,4,1`

Important point to note is that my joined list contains duplicate keys.  
What I want to do is transform that joined list of keys into a joined list of values, whilst maintaining the duplicates. So the end result should look like:

`apples,pears,apples,apples,apples,bananas,oranges,etc....`

I can create a Spilt Text column, then use that to create a multi-relation, and then use another joined list to get the values through that relation, BUT… I lose the duplicates.

 ![Screen Shot 2021-04-19 at 8.32.42 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/b/bb2a9efe3830b41025785a6d28a8b75e638b7eea.png)

I feel like this should be trivial. What am I missing?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 19, 2021, 12:42pm UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/2 "2021-04-19T12:42:04Z")

</div>

Won’t scale well, but using a template column is the most direct option in my opinion.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 19, 2021, 12:44pm UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/3 "2021-04-19T12:44:08Z")

</div>

A template column, how?

Speaking of scale, my real joined list is dynamic, and could contain thousands of keys…

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 19, 2021, 12:45pm UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/4 "2021-04-19T12:45:32Z")

</div>

If it’s thousands then this won’t work haha. I was thinking if you have a small number of items then just replace the numbers directly by the text, which is already cumbersome (as we can’t replace by a “custom text”.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 19, 2021, 12:47pm UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/5 "2021-04-19T12:47:06Z")

</div>

mmm, where is @Jeff_Hager when you need him? 🤣

---

<div class="post-metadata">

**Author:** ![Lucas\_Pires](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lucas_pires/32/64863_2.png) [@Lucas\_Pires](https://community.glideapps.com/u/Lucas_Pires)\
**Post date:** [April 19, 2021, 1:58pm UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/6 "2021-04-19T13:58:00Z")

</div>

Got it, I’ve already tried to do it, but no success yet.

Like `=UNIQUE` formula in GSheets, right?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 19, 2021, 3:28pm UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/7 "2021-04-19T15:28:36Z")

</div>

No, no - unique is easy. I want the opposite of unique 😝

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [April 19, 2021, 3:42pm UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/8 "2021-04-19T15:42:46Z")

</div>

hola @Darren_Murphy,

Do you need anything like this:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/c/7cc87de945b02dde44d30bcb4fb20292b97aae7c.png)

to have this?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/d/ed79f9096167bd08886134d5930b996b4dd7cdd0.png)

let me know if this works for you although I think i can narrow the final list to be based on customer only…

Saludos!

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 19, 2021, 4:00pm UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/9 "2021-04-19T16:00:16Z")

</div>

> [@gvalero](#):
>
> let me know if this works for you although I think i can narrow the final list to be based on customer only…

yes… no… maybe, I’m not sure. It’s a bit difficult to tell.

Maybe if I state my challenge a little differently.

Imagine that you have a column that contains a big long list of Row IDs from your User Profiles sheet. Maybe 100, or maybe 500… whatever. And the same Row ID can be there multiple times.

Now how would you transform that joined list of Row ID’s into a joined list of User Names, with every User Name replacing the corresponding Row ID, _INCLUDING_ the duplicates? So if the original joined list has Row ID “xyz” 25 times, then the User Name that corresponds to Row ID “xyz” should be in the new joined list 25 times.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [April 19, 2021, 4:05pm UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/10 "2021-04-19T16:05:20Z")

</div>

🙃

let me reread your problem , I was looking for another way using another point of view.

---

<div class="post-metadata">

**Author:** ![Lucas\_Pires](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lucas_pires/32/64863_2.png) [@Lucas\_Pires](https://community.glideapps.com/u/Lucas_Pires)\
**Post date:** [April 19, 2021, 4:15pm UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/11 "2021-04-19T16:15:12Z")

</div>

Oh yeah… the opposite 🙃 maybe I read upside down

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [April 19, 2021, 6:43pm UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/12 "2021-04-19T18:43:59Z")

</div>

@Darren_Murphy

and now?

This would be your list where to search

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/c/ece1d1698c35c8abb1c603e52fd35e083e375157.png)

and here you have what you want … I think 🙃

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/4/547c6cade3c8fe7972fac357371ce131c27f6d15.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/8/5808aef6e4f88051e78e7d63632de4c1943b8cd9.png)

Does it work for you?

Saludos

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 19, 2021, 11:31pm UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/13 "2021-04-19T23:31:24Z")

</div>

I still can’t tell if that’s a solution or not. Where is the joined list of IDs in your example (ie. my starting point)?

It needs to start with this:  
1,1,1,3,2,1,2

And end with this:  
apples,apples,apples,bananas,pears,apples,pears

And that should be in a single row

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [April 20, 2021, 1:02am UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/14 "2021-04-20T01:02:24Z")

</div>

Well, if you want to have your list based on ID, here it’s

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/c/4c0c4b2451b5104665691b9fe6662bf9070fcac5.png)

but at the end: do you want to have in your final list (my **jl\_Final List** column) the same sequence/order showed in your 2nd table? It’s quite difficult!

If you are going to create a chart based on fruit ID’s qty, I don’t see the problem with my **jl\_Final List** column? The order in the list doesn’t matter. 😇

Saludos Darren

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 20, 2021, 1:10am UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/15 "2021-04-20T01:10:13Z")

</div>

> [@gvalero](#):
>
> but at the end: do you want to have in your final list (my **jl\_Final List** column) the same sequence/order showed in your 2nd table? It’s quite difficult!

The order is not important. Maintaining the same count of each element _is_ important.  
But I think you’re still not understanding the challenge.

- You have ONE row in your table
- In that row is a single column, containing a joined list: `1,1,1,3,2,1,2`
- The challenge is to change that Joined List of numbers (keys) into a Joined List of names (values)

The keys-\>values mapping is available in another table, ie:

![Screen Shot 2021-04-19 at 8.25.38 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/1/b1b8815c3b6cdfe792393e71a854910c00a6e4e6.png)

My backup plan is to do this with a script, but it’s a bit frustrating that I can’t find a Glide solution, because it seems such a simple thing to do. 😣

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 20, 2021, 1:50am UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/16 "2021-04-20T01:50:29Z")

</div>

I’ve been trying to think about this today, but nothing is coming to mind yet. How is your original joined list of keys created? I wonder if it would just be easier to create the joined list with names instead of keys to begin with.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 20, 2021, 2:22am UTC](https://community.glideapps.com/t/transforming-a-joined-list-of-keys-into-a-joined-list-of-values/25758/17 "2021-04-20T02:22:55Z")

</div>

Thanks Jeff.  
Yes, it would be much easier to do that.  
The catch is that these need to be translated into multiple languages on the fly…

The example I gave was deliberately simple so as to demonstrate the crux of the challenge. The real life scenario is quite a bit more complicated 🙂
