Custom Validation

Is there a way to run some JS code for a custom validation rule & message? I see the “validation type” can be scripted, but it seems to expect one of the existing validation types to be specified (i.e. regex). I want to run a block of code for validation and return true/false. Separately, I want to provide a specific error message if that validation returns false.

My specific use case is an async unique check on a Text Input. I want to hit an API on input to verify uniqueness, then fail validation.

Hey there @bstone! This is a great question - right now there’s no native way to do this in Retool (I’ve created separate JS queries to at least tell me if the input is valid, but there’s no way to hook it up to actually prevent invalid inputs). This is a common request and definitely something we’re thinking about building.

The issue you brought up about having to specify existing validation types is a known bug that we’ll hopefully get to soon (ideally this week).

P.S: moving this over to #feature-requests.