# Question: How to check if record already exists in Database?

**URL:** https://community.glideapps.com/t/question-how-to-check-if-record-already-exists-in-database/19669
**Category:** Ask for Help
**Created:** [December 10, 2020, 5:04pm UTC](https://community.glideapps.com/t/question-how-to-check-if-record-already-exists-in-database/19669 "2020-12-10T17:04:32Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Steven](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/steven/32/15309_2.png) [@Steven](https://community.glideapps.com/u/Steven)
#### Post date: [December 10, 2020, 5:04pm UTC](https://community.glideapps.com/t/question-how-to-check-if-record-already-exists-in-database/19669/1 "2020-12-10T17:04:32Z")

</div>

I am looking to solve a scenario where I populate a database without creating duplicates, here is the use case…

I have two databases, 1 for Repair Claims and the other for Equipment Make & Model.

Use case is…

1. User submits repair claim form that has text input for Make and Model.
2. Upon submit, IF Computer Make & Model does NOT exist in Make and Model spreadsheet, then create a record for that Make and Model.
3. Otherwise, IF Computer Make & Model does exist, DO NOT create a Make & Model record.

Again, the purpose is to build the spreadsheet in time but also prevent duplicates. Any suggestions?

---

<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: [December 10, 2020, 5:41pm UTC](https://community.glideapps.com/t/question-how-to-check-if-record-already-exists-in-database/19669/3 "2020-12-10T17:41:40Z")

</div>

You could use a UNIQUE formula in the Google sheet to dynamically build the list in the Make/Model sheet based on the data in the Repair Claims sheet.

---

<div class="post-metadata">

### Author: ![Steven](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/steven/32/15309_2.png) [@Steven](https://community.glideapps.com/u/Steven)
#### Post date: [December 11, 2020, 1:38am UTC](https://community.glideapps.com/t/question-how-to-check-if-record-already-exists-in-database/19669/4 "2020-12-11T01:38:26Z")

</div>

Jeff, do you have an example of the UNIQUE formula? To build the list of make/model…

---

<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: [December 11, 2020, 1:39am UTC](https://community.glideapps.com/t/question-how-to-check-if-record-already-exists-in-database/19669/5 "2020-12-11T01:39:36Z")

</div>

> **[Google Sheets: =UNIQUE() - Teacher Tech](https://alicekeeler.com/2017/12/23/google-sheets-unique/)**
>
> Google Sheets UNIQUE is a function unique to Google Sheets spreadsheets. Quickly get a unique list of values out of a list of repeating values.

Here’s an article you can read through.

---

<div class="post-metadata">

### Author: ![Steven](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/steven/32/15309_2.png) [@Steven](https://community.glideapps.com/u/Steven)
#### Post date: [December 11, 2020, 1:41am UTC](https://community.glideapps.com/t/question-how-to-check-if-record-already-exists-in-database/19669/6 "2020-12-11T01:41:04Z")

</div>

Thank you!

---

<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: [December 11, 2020, 1:41am UTC](https://community.glideapps.com/t/question-how-to-check-if-record-already-exists-in-database/19669/7 "2020-12-11T01:41:30Z")

</div>

Let us know if you need help with this!

---

<div class="post-metadata">

### Author: ![Steven](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/steven/32/15309_2.png) [@Steven](https://community.glideapps.com/u/Steven)
#### Post date: [December 11, 2020, 1:52am UTC](https://community.glideapps.com/t/question-how-to-check-if-record-already-exists-in-database/19669/8 "2020-12-11T01:52:15Z")

</div>

Your article worked perfectly. Thank you so much!

---

<div class="post-metadata">

### Author: ![Steven](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/steven/32/15309_2.png) [@Steven](https://community.glideapps.com/u/Steven)
#### Post date: [December 11, 2020, 1:54am UTC](https://community.glideapps.com/t/question-how-to-check-if-record-already-exists-in-database/19669/9 "2020-12-11T01:54:22Z")

</div>

@Mark Do you know if it is possible to use the UNIQUE formula (the one in Google Sheets) in Glide tables?

---

<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: [December 11, 2020, 6:01am UTC](https://community.glideapps.com/t/question-how-to-check-if-record-already-exists-in-database/19669/10 "2020-12-11T06:01:55Z")

</div>

I’m not aware of a way to dynamically build data in a sheet based on another sheet. I would love that option since a large part of my app is centered around the UNIQUE formula to build it.

---

<div class="post-metadata">

### Author: ![Mark](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark/32/125_2.png) [@Mark](https://community.glideapps.com/u/Mark)
#### Post date: [December 11, 2020, 2:01pm UTC](https://community.glideapps.com/t/question-how-to-check-if-record-already-exists-in-database/19669/11 "2020-12-11T14:01:35Z")

</div>

Couldn’t you do a relation to the Make and Model, and if the relation is empty, add the row?

---

<div class="post-metadata">

### Author: ![Steven](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/steven/32/15309_2.png) [@Steven](https://community.glideapps.com/u/Steven)
#### Post date: [December 11, 2020, 3:34pm UTC](https://community.glideapps.com/t/question-how-to-check-if-record-already-exists-in-database/19669/12 "2020-12-11T15:34:19Z")

</div>

@Mark Yes, I believe that would work. Thank you so much!
