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 Glide Record Object to string

anvitha ash
Tera Contributor

Hi,

 

I am getting object when I'm gliding the record, I want to get the number of RITM. How we can achieve this ?

 

anvithaash_0-1698061019587.png

 

Please some one help me with this. Thanks in advance 

 

1 ACCEPTED SOLUTION

@anvitha ash 

Ahh ok! you are querying with number so your addQuery should be like below

 

gr.addQuery('parent.number',numb);

View solution in original post

6 REPLIES 6

if you need multiple numbers then your script should be like below

 

var numb = 'ADP0002427';

var gr = new GlideRecord('sc_req_item') ;

gr.addQuery( 'parent.number',numb) ;

gr.query();

while(gr.next())

{

gs.info (gr.number.toString()) ;

}

 

 

Thanks for helping me out