Regex Data Validation Needed

Hi @Mark,

It seems as though every app I’m creating nowadays is in dire need of data validation for forms. Is there ANY way we can have such a feature? Whether it’s regex or a set of common data validation checks (eg. is a 10-digit phone number, has 5 characters, is a number greater than 10).

Thanks for the consideration.

5 Likes

Could you give a bunch more concrete examples, please?

Sure!

  • Text; “State” column has two characters.
  • Number; Zip code is a 5 digit number only
  • Text: Email address is formatted like x@y.z
  • Text; URL contains https://a.b
  • Text: Full Name contains 2 words
  • Number: Price cannot be negative
  • Date: End Date >= Start Date or Today

Need more?

6 Likes

+1 . Some of these are US standards. Please @Mark do it global or customizable in case it is done. Thanks

1 Like

Right. They are…so RegEx would allow us to define the data validation parameters.

4 Likes

A few issues/questions:

  • Why don’t you use an Email Entry for the email?
  • You couldn’t express “End Date >= Start Date” in a regex.
  • As a start, what if you could attach necessary conditions to add/edit/form screens, such as “Price > 0” and “End Date is later than Start Date”?
1 Like

Yes! The third bullet point is clutch. And for text/number fields: number of characters/digits?

1 Like

Makes sense. “Number of digits” is a bit weird. For numbers you usually want a high and a low limit, whereas for codes, like ZIP codes or state codes, you want an exact number of letters/digits/whatever, or maybe also a min/max number of symbols.

3 Likes

That works for me!

It would be best if we can have the similar feature which Google Form has e.g. some inbuilt data validation plus also custom field to enter custom regex.

1 Like

Just picking up on this thread and some of @Mark comments. I have a great potential customer who I can move from an old .NET solution to Glide very easily, except for one thing. The current solution captures data from users but requires field validation. It kills me that I can’t help them without some fairly basic validation, so just wondering if there were any plans in the pipeline?

@V88 What specific validations do you need?

I would like the following:

  • ability to restrict a negative number
  • ability to set maximum or minimum number counts
  • ability when selecting date to be today or future dates (not previous dates that have passed)
  • zip codes
  • phone numbers
  • time masking inputs (not date just time)
  • ability to prevent “letters” from being entered into “number” fields

HI @Mark thanks for the reply, for this specific customer we would need:

At a minimum:

  • Range for integer number (min - max)
  • Range for decimal number (min - max)
  • Date (future only)

Would be nice:

  • Postal code
  • Phone number
  • Specific format fior a registration number e.g. AAAA33333

It strikes me that the ability to assign a RegExe to a text entry field would probably cover all bases, although I appreciate not very user friendly if you’re not a RegEx person.

Thanks

yes please. regex would allow for epic flexibility. and solve lots of nit picky issues, that i haven’t even encountered yet. one example: i need data validation for phone numbers. sometimes requiring the: the plus symbol and country code ,and others just the local number.

1 Like

Is there any update on this? I have a project in mind but i need data validation to use glideapp for this

What specific type of data validation do you need? We may do something for you with an Experimental Code snippet.

My understand on the (newly release) experimental code column is that is “The experimental code column is not designed for code that performs actions. It should only be used to compute data or call data from other services.”

I dont understand how this can be used for data entry validation: When a user is entering data into a form. I dont want them to submit invalid data. Google Forms has an excellent regex implementation (for as basic as g forms is, the implementation of regex still makes it one of the most powerful forms apps on the market)

My biggest desire to to have data validation for phone numbers, so the send whatsapp message url button will send to a valid phone number. Forcing a + at the beginning of the number is a pretty safe way to insure that I will have the full valid phone number for whatsapp. I work with international numbers, so I cannot add this myself.

There are so many uses above that people have mentioned that would be ideal. Unfortunately, most apps are american centric, so when the develop say a phone number formatting mask, they sometimes forgot that the rest world isnt america and has to deal with things like country codes.

its just honestly better to provide regex so that when the pretty solutions just were developed to meet every case need, regex can come to the rescue.

Can the experimental code column snippet do this?

If you use a custom form and point your input components at user-specific columns, then there is no reason why you couldn’t use this new column type to do on-the-fly data validation. It’s a great use case for this feature, I think.

2 Likes

for example of "Number of Digits"I can tell you that in IL the ID is conssisted of exactly 9 digits.
another exaple is that a mobile phone should have 10 digits but a landline phone should have only 9.