# Joined List with only unique values

**URL:** <https://community.glideapps.com/t/joined-list-with-only-unique-values/70158>\
**Category:** Ask for Help\
**Created:** [January 28, 2024, 2:26pm UTC](https://community.glideapps.com/t/joined-list-with-only-unique-values/70158 "2024-01-28T14:26:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattLB](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mattlb/32/41284_2.png) [@MattLB](https://community.glideapps.com/u/MattLB)\
**Post date:** [January 28, 2024, 2:26pm UTC](https://community.glideapps.com/t/joined-list-with-only-unique-values/70158/1 "2024-01-28T14:26:30Z")

</div>

Is their a standard methodology for creating a JL that contains only Unique values from the query/relation? E.g. -

1 | a  
2 | a  
3 | b  
4 | c  
5 | a  
6 | b

would yield a,b,c

Thanks

---

<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:** [January 28, 2024, 2:28pm UTC](https://community.glideapps.com/t/joined-list-with-only-unique-values/70158/2 "2024-01-28T14:28:33Z")

</div>

A bit of a round about way is as follows:

- Start with a joined list
- Convert that to an array with split text
- Make that unique with Unique Elements
- Take another joined list from the unique array

Another way would be to create a column in the source table that only contains unique values:

- Add a RowID column
- Create a single relation that matches the value you are concerned with with itself
- Use a lookup to fetch the RowID via the relation
- Add an if-then-else column:  
– If RowID is lookup RowID, then value
- Take a joined list of the if-then-else column

---

<div class="post-metadata">

**Author:** ![MattLB](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mattlb/32/41284_2.png) [@MattLB](https://community.glideapps.com/u/MattLB)\
**Post date:** [January 28, 2024, 3:04pm UTC](https://community.glideapps.com/t/joined-list-with-only-unique-values/70158/3 "2024-01-28T15:04:33Z")

</div>

> [@Darren\_Murphy](#):
>
> - Start with a joined list
> - Convert that to an array with split text
> - Make that unique with Unique Elements
> - Take another joined list from the unique array

I do the former (the above) and the initial queries can return 1,000+ results which I convert/convert/convert to get to the unique array/list. Final unique arrays have dozens or scores of unique items.

Is the alternative method better/more efficient or scales better? I can use this since most my tables have RowIDs. Not really sure what is efficient/fast/scale within Glide.

---

<div class="post-metadata">

**Author:** ![burningmikey](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/burningmikey/32/49706_2.png) [@burningmikey](https://community.glideapps.com/u/burningmikey)\
**Post date:** [January 28, 2024, 3:26pm UTC](https://community.glideapps.com/t/joined-list-with-only-unique-values/70158/4 "2024-01-28T15:26:50Z")

</div>

Did you consider using a JavaScript column?

---

<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:** [January 28, 2024, 3:29pm UTC](https://community.glideapps.com/t/joined-list-with-only-unique-values/70158/5 "2024-01-28T15:29:13Z")

</div>

A third alternative would be JavaScript, as I see @burningmikey just suggested. You could feed your original Joined List into that and write some code to remove duplicates.

To be honest, I’m not sure which would be most efficient. If you’re dealing with a large number of rows, then I’d probably steer away from option 2, as self relations have been known to cause performance issues with very large tables.

---

<div class="post-metadata">

**Author:** ![MattLB](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mattlb/32/41284_2.png) [@MattLB](https://community.glideapps.com/u/MattLB)\
**Post date:** [January 28, 2024, 3:38pm UTC](https://community.glideapps.com/t/joined-list-with-only-unique-values/70158/6 "2024-01-28T15:38:04Z")

</div>

@burningmikey - not a Javascript person so I did not.

@Darren_Murphy - thanks as always, will stay the course since it works - just “looks ugly”

PS. I think Joined lists should offer a ‘unique only’ check box when creating. Would mirror “count unique” in Roll-ups to give you the list of unique items in the count.

---

<div class="post-metadata">

**Author:** ![burningmikey](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/burningmikey/32/49706_2.png) [@burningmikey](https://community.glideapps.com/u/burningmikey)\
**Post date:** [January 28, 2024, 3:44pm UTC](https://community.glideapps.com/t/joined-list-with-only-unique-values/70158/7 "2024-01-28T15:44:27Z")

</div>

Sounds good.

You know you can always use chatGPT to generate JavaScript for you. You just explain what you want to do, add the format of your data, show an example of the output you want and it will do the work for you.

---

<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:** [January 28, 2024, 3:45pm UTC](https://community.glideapps.com/t/joined-list-with-only-unique-values/70158/8 "2024-01-28T15:45:57Z")

</div>

Just in case you wanted to give the JavaScript option a try:

```auto
const array = p1.split(', ');
const unique = [...new Set(array)];
return unique.join(',');

```

 ![CleanShot 2024-01-28 at 23.44.55@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/1/713bf96b5315bcbcef8d010d283f34718a212c88.jpeg)

---

<div class="post-metadata">

**Author:** ![MattLB](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mattlb/32/41284_2.png) [@MattLB](https://community.glideapps.com/u/MattLB)\
**Post date:** [January 29, 2024, 2:07pm UTC](https://community.glideapps.com/t/joined-list-with-only-unique-values/70158/9 "2024-01-29T14:07:40Z")

</div>

> [@Darren\_Murphy](#):
>
> ```auto
> const array = p1.split(', ');
> const unique = [...new Set(array)];
> return unique.join(',');
> 
> ```

Worked as expected. Thanks…now another tool in the old toll box!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [February 5, 2024, 2:08pm UTC](https://community.glideapps.com/t/joined-list-with-only-unique-values/70158/10 "2024-02-05T14:08:26Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
