Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

The easy way to encode JSON GlideRecord

Trung
Kilo Guru

Hi all

I sure that you see some troubleshooting when you find a way to encode GlideRecord to JSON string

And I have the easy way to do it with OOTB script include

 

var util= new global.GlideRecordUtil();
var grinc= new GlideRecord("incident");
grinc.get("your_sys_id");
var hashmap={};
util.populateFromGR(hashmap,grinc);//use this function to populate all fields to object hashmap and after that we will encode the hashmap object
gs.print(JSON.stringify(hashmap));
3 REPLIES 3

Ankur Bawiskar
Tera Patron

@Trung 

Is this a question or you are willing to share some content in community?

hi @Ankur Bawiskar 

I just share the content to community to people.

Well before the new UI community I can create a article but now I cannot create article so go to this and post it

Thanks for sharing!