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.

Embedded List

Suyash Joshi
Tera Contributor

Hello Everyone,

I am stuck on a small work of embedded list, actually I am new toward this interface and don't know how to solved.

I have two custom named:- u_calculated and u_xyz_table. 

Firstly I create a field name u_doo as a reference field in u_calculated table and open my second table u_xyz_table navigate to form layout and add the embedded list named as Calculated->Doo.

After that I submit a record and make sure too add some record of the embedded list as well.

Now I need to run a script in Background Script and I need to print record with embedded list.

My script:-

var gk= new GlideRecord('u_calculated'); //Your Table In which reference field is created
gk.get('f6d2d95597ef3910a976358e6253af23');//Sys_Id of the u_calculated Table
var gh= gk.u_doo.toString(); // Use of Dot walking
var gr= new GlideRecord('u_xyz_table');//Reference Table of the Field you use as Embedded.
gr.query();
while (gr.next()) {
var field1Value = gr.u_doo.toString();
var field2Value = gr.u_doo.u_new.toString();
gs.print(gr.getValue('u_calculated.field1Value'));
gs.print(gk.getValue('u_calculated.field2Value'));
}

This script only make null answer.

Any help would be very helpful.

Thanks and Regards,

Suyash

0 REPLIES 0