Regex Data Validation Needed

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
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?

Sounds like you’re still using the native Glide form. As I mentioned, you’d need to use a Custom Form.

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).

1 Like

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