Table Validation to find gap and overlap

I am trying to adopt Retool to build a data entry for Geology logging. I need a validation that will check the From and To columns in my query/table in Retool. So the idea is to prepare a Validate button that will check if there are nay From and To rows that are overlap each other or if there is gap.

Is there anyone familiar with this?

Hey Dahani - welcome to the forum!

If you use the form component you can set validation rules on each component inside the form and those can be validated on submission of the form (form won't submit unless all fields are valid).

From there you can create any default or custom rule for each individual item of the form!

Hope this helps!

Hi Hello Stefancvrkotic

Thanks for your reply. I already added some validation to my form, similar to what you suggest.
But I still cannot figure out the easy way to stop or at least notify users not to enter the data which will cause gap or overlap with previous data they already entered previously (let say the day before).

For now, I still can enter the data for example KTD001, from: 10, to: 12, which is overlap with the first record in the image attached.

Thanks for your time.

Hey there again, in that case you need to additionally have all results for a specific ID within a query.

When someone tries to enter values you can check those against all values such that 'from' value must not be in-between any of the from/to values (same applies to 'to' value).


This will return true if the selectes from/to falls into any of the stored from/to based upon which you can disable submit/show notification.

Hope this helps!

Hi Stefacvrkotic

Thanks for your solutions. I think I can use it.