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

VivekSattanatha
Mega Sage
Mega Sage

Hi,

 

Please add gr.next() after the query then you will get the number.

 

If you want to the full gliderecord object then after the gr.next() put the below lines

var responseObject = {}; //hashmap object variable to store final response
var getData = new GlideRecordUtil().getGR("sc_req_item", "gr.sys_id"); //pass the table name and Record sys_id to get the GlideRecord instance
var ignoreFields = {"sys_created_on": true, "sys_updated_by": true}; //Pass the fields that you want to exclude in the final response
new GlideRecordUtil().populateFromGR(responseObject, getData, ignoreFields); //The main function to retrieve the data
gs.print(JSON.stringify(responseObject, null, 4)); //Decode the object

 

Regards,

Vivek

Hello @VivekSattanatha ,

 

Thanks for your response 

Added gr.next(); , still having the same issue 

anvithaash_0-1698063066233.png

 

@anvitha ash 

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

 

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

Hi @VivekSattanatha ,

 

yes now it's displaying the RITM number, but the parent value associated with multiple RITM's but the result is displaying only one RITM 

anvithaash_0-1698064222530.png