Field validation

Does baserow provide a way to set validations for fields? Can I make the single text field reject certain content?

Not at the moment, but I could see how this would be valuable. I have an idea of how it’d work in my mind, but can you describe your use case (preferably with multiple field types) to make sure we’re aligned?

We’d have to take into consideration validation for various field types, not just single line text, for example.

Once we do that, we can create an issue on GitLab and then get it on the roadmap. :motorway:

This issue does exist already actually, take a look and ensure it describes your use case accurately (and if not, feel free to comment on GitLab as well): Field value constraints (#647) Ā· Issues Ā· Bram Wiepjes / baserow Ā· GitLab

This will be helpful for many scenarios . Here is some examples that I can think of

  1. Contact management: When managing contact information in Baserow, field validation can help ensure that phone numbers, email addresses, and postal codes are entered correctly and consistently. This can help prevent errors when trying to reach out to clients or customers.
  2. Inventory management: When managing inventory data in Baserow, field validation can help ensure that product codes, SKU numbers, and other identifying information is entered accurately. This can help prevent mistakes when tracking inventory levels, fulfilling orders, or managing returns.
  3. Financial tracking: When using Baserow to track financial data such as expenses, revenue, and budget information, field validation can help ensure that data is entered correctly and consistently. This can help prevent errors when making financial decisions or reporting financial information to stakeholders.
  4. Project management: When managing project data in Baserow, field validation can help ensure that data such as task names, deadlines, and budgets are entered correctly and consistently. This can help prevent errors when tracking progress, assigning tasks, or reporting project updates to stakeholders.
  5. Event management: When managing event data in Baserow, field validation can help ensure that dates, times, and locations are entered correctly and consistently. This can help prevent errors when scheduling events, sending invitations, or managing logistics.

Also, if we can have conditional fields that work based on existing field validations applied to other existing fields, that would be even more fantastic

here are some scenarios where that will be helpful

  1. Address management: When managing address information in Baserow, applying a condition on another field based on the validation of one field can help ensure that the data entered is accurate and consistent. For example, if a field is validated to accept only valid postal codes for a specific country, a condition can be applied to ensure that the related field for the city and state/province is also populated based on the selected postal code.
  2. Product management: When managing product information in Baserow, applying a condition on another field based on the validation of one field can help ensure that the data entered is accurate and consistent. For example, if a field is validated to accept only a specific category of products, a condition can be applied to ensure that the related field for the manufacturer or supplier is also restricted to only those that provide that specific category of products.
  3. Order management: When managing order information in Baserow, applying a condition on another field based on the validation of one field can help ensure that the data entered is accurate and consistent. For example, if a field is validated to accept only valid credit card numbers, a condition can be applied to ensure that the related field for the expiration date is also validated to ensure that it is in the correct format.
  4. Employee management: When managing employee information in Baserow, applying a condition on another field based on the validation of one field can help ensure that the data entered is accurate and consistent. For example, if a field is validated to accept only valid employee IDs, a condition can be applied to ensure that the related field for the employee’s name and department is also populated based on the selected employee ID.
  5. Event management: When managing event information in Baserow, applying a condition on another field based on the validation of one field can help ensure that the data entered is accurate and consistent. For example, if a field is validated to accept only valid dates, a condition can be applied to ensure that the related field for the start and end times of the event is also validated to ensure that they are in the correct format.

Hope that helps

3 Likes

Sounds great Hiram. I’m glad that we’re going in a great direction

1 Like

Hello team! Do you think the field validation will be ready anytime soon?

It would be incredibly useful to have cleaner databases, especially for the contact management (phone numbers, email, postal codes).

Thanks for the answer!

I second this !
I have the same need for my DB

Hey @Anatole and @Paragon, thank you for sharing your feedback. I see that the issue is not at the top of the development list, but scored pretty high. I’ll check with the team if we can prioritize it a bit higher. :raised_hands:

Hi,
I would be another person who would benefit if this feature were implemented in Baserow.

The Application Builder offers a ā€œText inputā€ element, and one of its configurations is Number Validation, but I’m pretty sure it does not support floating-point number validation:frowning:

Tried both: comma and period as a separator, non of them is recognized by number validator:
image

Is there any workaround to validate the input format in the Application Builder? For example, using regex?

Hi @Karol!

This topic is about field-level validation in a database table, what you’re referring to is validation in the application table using form elements.

I’m pretty sure it does not support floating-point number

You’re quite right, we don’t currently support that.

Is there any workaround to validate the input format in the Application Builder? For example, using regex?

Not at the moment, but we will offer more form element validation options in the future.

Cheers,
Peter Evans

Is there any option to pass floating-point number by Application Builder input elements?

Hi @Karol,

You should be able to submit values now in your forms, you just can’t validate them as a number.

Cheers,
Peter Evans

I’ve checked with the team, and we don’t think this will be implemented in the next two quarters since it’s a pretty complex feature to implement properly. We’ll let you know if anything changes. :slightly_smiling_face:

Hi again @picklepete

I see that this works when assigning a floating-point value through the form view. However, when I try to do the same in the Application Builder using a Form element with a test input (validation set to ā€˜Any’), I still cannot pass a floating-point value. A pop-up appears with the message: ā€˜Invalid form, one or more fields contain an invalid value.’

I tried both comma-separated and period-separated formats. The column to which this value is assigned is of type ā€˜Number’ with two decimal places and a space/comma as the decimal separator."

image

Could you take a look at this, please? I think this is one of the basic functionalities the Application Builder should have. Am I doing something wrong?

Hi @Karol,

The good news: we do support floating-point values. If your database table number field is setup with ā€œDecimal placesā€, the application builder can create and update rows properly. My ā€œ1.5ā€ gets inserted as ā€œ1.5ā€.

The bad news: if you change the number field’s ā€œThousand and decimal separatorā€ so that you can use ā€œ1,5ā€, there is indeed an issue inserting that value.

I’ll open a ticket for someone in our team to investigate this for you.

Cheers,
Peter Evans