# Regex Data Validation Needed

**URL:** <https://community.glideapps.com/t/regex-data-validation-needed/12753>\
**Category:** Feature Requests\
**Created:** [July 19, 2020, 2:11am UTC](https://community.glideapps.com/t/regex-data-validation-needed/12753 "2020-07-19T02:11:09Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![ccloudbbb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ccloudbbb/32/29819_2.png) [@ccloudbbb](https://community.glideapps.com/u/ccloudbbb)\
**Post date:** [August 4, 2021, 7:57am UTC](https://community.glideapps.com/t/regex-data-validation-needed/12753/21 "2021-08-04T07:57:53Z")

</div>

Hi Darren,  
Could you please describe this in greater depth. I’ve tried to get it to work and was unsuccessful

I setup the following Test:  
Added an Experimental Code Column using this: String length: [https://glide-yes-code-string-length.markprobst.repl.co](https://replit.com/@MarkProbst/glide-yes-code-string-length#function.js)  
It successfully counted the string length for phone number column in the table viewer  
I added a hint box using the new strength length exp column as the text. It displayed the current string length.  
I edited the phone number column → the hint box string length did not update in the edit form  
I added an on submit action using the new exp column to throw a sound/notification → glide app will not even process the column. no action resulted, on the if or and else clause.

So how to make this on the fly?

---

<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:** [August 4, 2021, 8:12am UTC](https://community.glideapps.com/t/regex-data-validation-needed/12753/22 "2021-08-04T08:12:33Z")

</div>

Sounds like you’re still using the native Glide form. As I mentioned, you’d need to use a [Custom Form](https://community.glideapps.com/t/how-do-i-create-a-custom-form/25014).

Essentially:

- Your phone number input would be written to a User Specific Column
- You then use the yes-code column to check the length of the input
- And then you use that result to control the user flow. There are a few different ways to do that. Personally, I like to keep as much logic as possible in my Glide tables, so I’d do something like:
- If-then-else column: If length is greater than X then blank, else `true` (where X is the max allowed length)
- Then in my custom form, I’d have a submit button with a custom action attached. That action would have two branches:
  - If “if-then-else column” is `true`, then do the other actions; Add Row, etc
  - Else Show Notification “Input too long” (or whatever)

You can also have warnings that appear that before the Submit button is tapped (and there is an example of that in my custom form demo).

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 4, 2021, 9:46am UTC](https://community.glideapps.com/t/regex-data-validation-needed/12753/23 "2021-08-04T09:46:45Z")

</div>

J’ai fait un script ce matin dans ce sens.

> [@RegEx Test](https://community.glideapps.com/t/regex-test/29977):
>
> Hello, Here is a script to test a string of characters according to a RegEx. For example, this is a test for a phone number. The parameters are: RegEx: RegEx format directly or via a text column (do not include / at the beginning and at the end) Text: String to test ReturnTrue: a column or a string or a value to return if the string matches the regex. ReturnFalse: a column or a string or a value to return if the string does not conform to the regex. link for YC [htt…](https://RegEx-Test.manun2.repl.co)

[Previous page](https://community.glideapps.com/t/regex-data-validation-needed/12753.md?page=1)
