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.

convert values to lowercase?

Servicenow10
Kilo Guru

hi,

 

i have 1 field which is a single line text, now i want to convert the value of that field to lower-case so i used .toLowerCase()

and toLowerCase.toString() methods but am getting values as undefined .

how to resolve this?

1 ACCEPTED SOLUTION

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

It should be used as .toString().toLowerCase();

For me the below script works fine, but my variable already has a string, you might need to convert it first using toString before converting to lower case

var x= 'HAHA';
alert(x);
x=x.toLowerCase();
alert(x);

 

-Anurag

-Anurag

View solution in original post

3 REPLIES 3

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

It should be used as .toString().toLowerCase();

For me the below script works fine, but my variable already has a string, you might need to convert it first using toString before converting to lower case

var x= 'HAHA';
alert(x);
x=x.toLowerCase();
alert(x);

 

-Anurag

-Anurag

the field which i want to convert is a single line text field so .toString is required?

Jaspal Singh
Mega Patron
Mega Patron

It should be fieldname.toLowerCase().toString()