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 get the label of the choice in scoped application?

Snehal Madakatt
Mega Sage

Hi Developers,

 

The below script i ran in background script and it works.

When i am using the same thing in the scoped application in script include its not working. I am calling this script include from client script.

 

Can someone suggest how to get the display value in scoped application.

 

var grSAE = new GlideRecord('sn_audit_engagement');
grSAE.addEncodedQuery("active=true^taskLIKEENG0000223");
grSAE.orderBy('number');
grSAE.setLimit(100);
grSAE.query();
if (grSAE.next()) {
var val =grSAE.engagement_type.getDisplayValue();
gs.print(grSAE.number + val);}
 
Regards,
Snehal
2 REPLIES 2

Community Alums
Not applicable

Hi @Snehal Madakatt ,

We can call script include from client script using Glideajax.

Follow this video to get an idea:

https://www.servicenow.com/community/developer-articles/how-to-call-script-include-from-client-scrip....

 

Hi @Community Alums ,

Thanks for reply.

 

I know that we can call script include from client script using Glideajax.

Actually problem is i want to get the display value of the choice type field "engagement_type" on Engagement table. I have used the client script & script include for this. Its working on the classic UI but on the workspace its not working.

 

var val =grSAE.engagement_type.getDisplayValue(); ==>its working only in native UI, not on workspace

 

Regards ,

Snehal