convert to lower case

joshishree
Kilo Contributor

var gr = new GlideRecord('sys_user');

gr.addQuery('first_name.toLowerCase()',another_variable);

gr.addQuery('last_name.toLowerCase()',lastnewname);

gr.query();

if(gr.next())

{

}

here another_variable and lastnewname are in lower case

I want the table fields also to be in lower case is it possible and how to do it

6 REPLIES 6

Jaspal Singh
Mega Patron
Mega Patron

Hi Bhagyashree,



No need of using .toLowerCase() as query does not look for case sensitivity unless we give value directly.


Shishir Srivast
Mega Sage

column name will always be in lower case.


harishdasari
Tera Guru

Dave Smith1
ServiceNow Employee
ServiceNow Employee

Bhagyashree Joshi wrote:



gr.addQuery('first_name.toLowerCase()',another_variable);


gr.addQuery('last_name.toLowerCase()',lastnewname);



  1. as others have said, "first_name" is in lower case anyway, so no need to apply this method
  2. as you've included the method in the quotes, the addQuery() function will see that all as literal text.

What's the use case behind this? Are you trying to lower-case some text before including it as a search parameter?