Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Need help on converting letters to Upper Case

shaik_irfan
Tera Guru

Hello,

I have a requirment where i need to convert all the entered text into Upper Case for that i wrote below script which is working fine in Native view but not in Service Portal view:

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }

	
	   var str = newValue.toUpperCase();
   if (str != newValue)
  g_form.setValue("emp_id", str);
	}

 

 

1 ACCEPTED SOLUTION

Chalan B L
Giga Guru

Hello Shaik,

**Mark the answer as correct and helpful, if it helped you...!!!

I just tried this in my PDI and checked in SP, it worked fine

Make sure in the Onchange client script --> you are making the UI type - "ALL"

 

used above code and find the below screenshots

 

find_real_file.png

 

After changing the group in SP view

 

find_real_file.png

View solution in original post

2 REPLIES 2

Chalan B L
Giga Guru

Hello Shaik,

**Mark the answer as correct and helpful, if it helped you...!!!

I just tried this in my PDI and checked in SP, it worked fine

Make sure in the Onchange client script --> you are making the UI type - "ALL"

 

used above code and find the below screenshots

 

find_real_file.png

 

After changing the group in SP view

 

find_real_file.png

Mike Patel
Tera Sage

try and make sure UI Type is set to All as Chalan mentioned in his post.

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }

	
	   var str = newValue.toString().toUpperCase();
   if (str != newValue)
  g_form.setValue("emp_id", str);
	}