Validation of Variable Value Length in a Custom App

Hi all, within my custom app, I’ve implemented a ‘Country’ field that exclusively accepts a 2-digit ISO code. I’m interested in limiting users to input only these 2 digits. Can this be achieved through variable validation?

To validate whether the user’s input is 2 digits, you can use the validate parameter.
Check this docs.

Example:

[
	{
		"type": "text",
		"label": "Country Code",
		"name": "countryCode",
		"validate": {
			"pattern": "\\b\\d{2}\\b"
		
		}   
	}
]

2 Likes