# Check for existing value

**URL:** <https://community.glideapps.com/t/check-for-existing-value/35055>\
**Category:** Ask for Help\
**Created:** [November 25, 2021, 8:48pm UTC](https://community.glideapps.com/t/check-for-existing-value/35055 "2021-11-25T20:48:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mzsadiek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mzsadiek/32/36021_2.png) [@mzsadiek](https://community.glideapps.com/u/mzsadiek)\
**Post date:** [November 25, 2021, 8:48pm UTC](https://community.glideapps.com/t/check-for-existing-value/35055/1 "2021-11-25T20:48:23Z")

</div>

Hi!

In my app, admins can create new users. However, I want the form to check if an existing user already uses the email address and username. How would I be able to create such a check?

---

<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:** [November 25, 2021, 11:40pm UTC](https://community.glideapps.com/t/check-for-existing-value/35055/2 "2021-11-25T23:40:15Z")

</div>

> [@How do I create a custom form?](https://community.glideapps.com/t/how-do-i-create-a-custom-form/25014/):
>
> I’m just dropping this here so I have something to refer people to when they ask. This is a simple concept app (copyable), that demonstrates the following techniques: Building custom forms for adding and editing list items (as an alternative to the native forms provided by Glide) Preventing duplicate new entries using [User Specific Columns](https://docs.glideapps.com/all/reference/data-editor/user-specific-columns) and [Relations](https://docs.glideapps.com/all/reference/data-editor/computed-columns/relation-column) Enforcing mandatory input items The use of visibility conditions and user specific booleans to control user flow There is nothing particula…

Make a custom form, then do a relation from your text entry to the list of existing emails/names. If the relation(s) is/are not empty then you show a text telling the user that the email/name already exists.

---

<div class="post-metadata">

**Author:** ![mzsadiek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mzsadiek/32/36021_2.png) [@mzsadiek](https://community.glideapps.com/u/mzsadiek)\
**Post date:** [November 26, 2021, 5:23pm UTC](https://community.glideapps.com/t/check-for-existing-value/35055/3 "2021-11-26T17:23:53Z")

</div>

Thanks for you reply. How would I make a relation if the field being filled is linked to where the email stored? Do I have to make a relation between the textfield and the column it stores the data?

---

<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:** [November 26, 2021, 5:32pm UTC](https://community.glideapps.com/t/check-for-existing-value/35055/4 "2021-11-26T17:32:15Z")

</div>

That’s correct.  
Your input component should be writing the value to a user specific column. You create the relation between that column and the final destination column.

You can make a copy of the app in that linked thread and study it to see how it works.

---

<div class="post-metadata">

**Author:** ![mzsadiek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mzsadiek/32/36021_2.png) [@mzsadiek](https://community.glideapps.com/u/mzsadiek)\
**Post date:** [November 26, 2021, 5:53pm UTC](https://community.glideapps.com/t/check-for-existing-value/35055/5 "2021-11-26T17:53:06Z")

</div>

Thanks! I will try it out and let you know

---

<div class="post-metadata">

**Author:** ![mzsadiek](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mzsadiek/32/36021_2.png) [@mzsadiek](https://community.glideapps.com/u/mzsadiek)\
**Post date:** [November 26, 2021, 10:38pm UTC](https://community.glideapps.com/t/check-for-existing-value/35055/6 "2021-11-26T22:38:03Z")

</div>

I’m currently trying to set this up. However, I notice on ‘text entry’ fields I am not able to make them required. On dropdowns (choices) I am able to make them required.

Any possibility to make text entry fields required in a custom form?

---

<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:** [November 26, 2021, 10:59pm UTC](https://community.glideapps.com/t/check-for-existing-value/35055/7 "2021-11-26T22:59:18Z")

</div>

You make them required by not allowing them to submit/move forward if the field in question is empty.

---

<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:** [November 27, 2021, 2:20am UTC](https://community.glideapps.com/t/check-for-existing-value/35055/8 "2021-11-27T02:20:18Z")

</div>

> [@mzsadiek](#):
>
> Any possibility to make text entry fields required in a custom form?

Unfortunately, no. This is one of the drawbacks of using custom forms.  
What I usually do is use double asterisks `**` to indicate required fields, and then as @ThinhDinh mentions, simply not allow the user to save if all pre-conditions are not met.

Again, if you look at the demo app, there is an if-then-else column that is used for this.

 ![Screen Shot 2021-11-27 at 10.18.13 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/9/39b9bdb67d6d9fd27d7607572b10a6a776c2b611.png)

That column only returns true if:

- The supplied name is not a duplicate of an already existing row, and
- The name is not empty

The column is then used in the custom action to determine whether or not the record can be saved.

---

<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:** [November 28, 2021, 2:21am UTC](https://community.glideapps.com/t/check-for-existing-value/35055/9 "2021-11-28T02:21:07Z")

</div>

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