Is it possible to add minimum character required for 'Multi-line text' variable type in Service Catalog?

2022_ServiceNow
Tera Expert

Hi everyone,

Is it possible to add the minimum characters required to the catalog field of variable type multi-line text?

Eg: I want a user to at-least write 30 characters before submitting.

Regards,

Priya

1 ACCEPTED SOLUTION

Muhammad Khan
Mega Sage

Use onSubmit()/onChange() catalog client script as per your requirement.

function onSubmit() {

    if(g_form.getValue('<multi_line_variable_backend_name>').length < 30){
		g_form.showFieldMsg('<multi_line_variable_backend_name>', 'Enter at least 30 characters.', 'error', true);
		return false;
	}
}

View solution in original post

15 REPLIES 15

Hi,

I cannot see validation regex in the type specification.

find_real_file.png

Regards,

Priya

Hi,

We can apply for single line text variables not for multiple line text variables.

 

Thanks,

Pavankumar

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

Hi Pavan,

Thank you so much!!

Hi,

Please select correct response so future readers will check that solution.

You marked incorrect which will not work for Multi-line text as per your requirement.

 

Thanks,

Pavankumar

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

Hi,

Thank you Pavan!!

Regards,

Priya