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.

How to dot walk in Business rule

shaik_irfan
Tera Guru

Hello Everyone,

I want to populate a field name which is present on u_bsa table.

On u_bsa table i field named as Req for which was dot walk by sc_req_item table, i want to display that Req for field name for which i written a script like below

i am getting a display value as undefined

var ritm = new GlideRecord('u_bsa');

if(ritm.get(current.sysapproval)){

var req_for = ritm.u_requested_for.name;   //Output i am getting is undefined

var ge = ritm.u_requested_item.number; // I am getting correct output here

gs.addInfoMessage(req_for);

gs.addInfoMessage(ge);

1 ACCEPTED SOLUTION

Try



var req_for = ritm.u_requested_item.u_requested_for.getDisplayValue()



Manish


View solution in original post

16 REPLIES 16

Suseela Peddise
Kilo Sage

Hi Irfan,



Try getDisplayValue()



var req_for = ritm.u_requested_for.getDisplayValue();



Hope this might be helpful.



Please like or mark correct based on the impact of the response.


I tried Suseela but it didnt populated


Chuck Tomasi
Tera Patron

What table is the BR running on? Can you include some screenshots of the BR so I have a better idea of what you are trying to accomplish and what you have done so far? Thank you.


Chuck,



I am writing script on Notification Scripting:



(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,


              /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,


              /* Optional GlideRecord */ event) {


                // Add your code here


var ritm = new GlideRecord('u_bsa');


if(ritm.get(current.sysapproval)){


var req_for = ritm.u_requested_for.name;


var ge = ritm.u_requested_item.number;


gs.addInfoMessage(req_for);


gs.addInfoMessage(ge);


template.print(""+ritm.u_requested_for.name);


//template.print(req_for);


}


})(current, template, email, email_action, event);