# How to Remove duplicated locations from a collection list

**URL:** <https://community.glideapps.com/t/how-to-remove-duplicated-locations-from-a-collection-list/81090>\
**Category:** Ask for Help\
**Created:** [April 1, 2025, 7:54am UTC](https://community.glideapps.com/t/how-to-remove-duplicated-locations-from-a-collection-list/81090 "2025-04-01T07:54:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![NixonIam](https://avatars.discourse-cdn.com/v4/letter/n/22d042/32.png) [@NixonIam](https://community.glideapps.com/u/NixonIam)\
**Post date:** [April 1, 2025, 7:54am UTC](https://community.glideapps.com/t/how-to-remove-duplicated-locations-from-a-collection-list/81090/1 "2025-04-01T07:54:45Z")

</div>

How can I make my app to display the location name and address only once if there are multiple records for the same location? ( like in the attached image )

 ![Duplicated_address](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/6/86a08df22638807fb48a27214146ad2cbdeb1fd3.jpeg)

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [April 1, 2025, 8:07am UTC](https://community.glideapps.com/t/how-to-remove-duplicated-locations-from-a-collection-list/81090/2 "2025-04-01T08:07:54Z")

</div>

Create a relation from the location name to itself without match multiple. Lookup the row IDs. You’ll notice that only the first occurrence of duplicates has a matching row ID and looked up row ID. Create a query column with a filter: row ID is this row’s looked up row ID.

This should return the table with unique values only along the location name.

---

<div class="post-metadata">

**Author:** ![NixonIam](https://avatars.discourse-cdn.com/v4/letter/n/22d042/32.png) [@NixonIam](https://community.glideapps.com/u/NixonIam)\
**Post date:** [April 1, 2025, 8:31am UTC](https://community.glideapps.com/t/how-to-remove-duplicated-locations-from-a-collection-list/81090/3 "2025-04-01T08:31:51Z")

</div>

I have to do it in the Data section? I can’t do in Layout section?

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [April 1, 2025, 9:34am UTC](https://community.glideapps.com/t/how-to-remove-duplicated-locations-from-a-collection-list/81090/4 "2025-04-01T09:34:06Z")

</div>

In the Data Editor.

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [April 1, 2025, 9:54am UTC](https://community.glideapps.com/t/how-to-remove-duplicated-locations-from-a-collection-list/81090/5 "2025-04-01T09:54:35Z")

</div>

The basic idea to “remove duplicates from a collection” is the filter the collection to only show the first occurrence of duplicates. The filtering can either happen in the layout editor (method 1) or in the data editor (method 2).

**Method 1: Filter with checkbox**

 ![Screenshot 2025-04-01 at 11.43.09](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/1/2160a4a0af0f726b2eb4822dd87d178600b2a55c.png)

In the Data Editor:

- Create a `Row ID` column
- Create a `Relation` column from Name to Name (not match multiple)
- Look up through the relation the row ID. This will give you the row ID of the first occurrence of your duplicates.
- Create an `If-Then-Else` column : if row ID is first occurrence row ID then true else null (empty). Now everywhere where you have a checked checkbox, you know that that row if the first occurrence of any duplicates you might have.

In the Layout Editor

- Create your collection
- In options on the right hand side, filter the collection : first occurrence checkbox is checked

 ![Screenshot 2025-04-01 at 11.51.29](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/d/8d135890671e51cff155addb36fd7f84e67cab7b.jpeg)

**Method 2: Unique table with Query column**

 ![Screenshot 2025-04-01 at 12.02.57](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/5/759b69e842ac7c62f5ef5580094358b057143ec7.jpeg)  
In the Data Editor:

- Instead of an if-then-else column (method 1 above), create a `Query` column and filter: Row ID is First Occurrence Row ID (it’s the same idea as above). You are querying the table and asking the query to return the rows of the first occurrence of duplicates.
- Here, only the first row of the Query column is useful.

In the Layout Editor:

- Create your collection
- As the source of the collection, select the `Query` column.

I’m not too sure which method I prefer. The method with query feels slightly cleaner, though it might be confusing that only the first row of that column is being used (it confuses me!).

---

<div class="post-metadata">

**Author:** ![NixonIam](https://avatars.discourse-cdn.com/v4/letter/n/22d042/32.png) [@NixonIam](https://community.glideapps.com/u/NixonIam)\
**Post date:** [April 1, 2025, 10:19am UTC](https://community.glideapps.com/t/how-to-remove-duplicated-locations-from-a-collection-list/81090/6 "2025-04-01T10:19:19Z")

</div>

K I will study your solutions. Thanks for your help.

---

<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 2, 2025, 12:33am UTC](https://community.glideapps.com/t/how-to-remove-duplicated-locations-from-a-collection-list/81090/7 "2025-04-02T00:33:14Z")

</div>

Why do you have duplicated locations in the first place?

I guess you would want a mechanism to prevent that if your app is allowing users to submit?

---

<div class="post-metadata">

**Author:** ![NixonIam](https://avatars.discourse-cdn.com/v4/letter/n/22d042/32.png) [@NixonIam](https://community.glideapps.com/u/NixonIam)\
**Post date:** [April 2, 2025, 5:36am UTC](https://community.glideapps.com/t/how-to-remove-duplicated-locations-from-a-collection-list/81090/8 "2025-04-02T05:36:40Z")

</div>

yes users enter information into a form, including the location name and address. do you have a solution for the problem?

---

<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 3, 2025, 1:39am UTC](https://community.glideapps.com/t/how-to-remove-duplicated-locations-from-a-collection-list/81090/9 "2025-04-03T01:39:55Z")

</div>

![CleanShot 2025-04-03 at 08.39.32](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/6/8619a827b666dc8bdb056c14411867272069398e.png)

Please check the Users tab here.

> **[Prevent Form Submission](https://go.glideapps.com/template/RyEnvpZcpTrYQ9fO0DAd-template-published?privateTemplateToken=XiH3D6fccsdplOOdr4uL)**
