- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 02:31 PM
Hello,
I trying to populate the fields below when a business app is selected. It is working but bringing back value instead of Display Value. AND I am trying to bring back user cost center and populate
Any assistance is appreciated.
Field: Data Classification<-Auto-populated by Business Application field (Data Classification')
Thanks,
Chad
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2025 02:59 AM - edited 01-26-2025 03:00 AM
Hello @purdue
Here is the updated script include:
getdataclassfication: function() {
var result = {};
var appName2 = this.getParameter('sysparm_appName');
var grAppRole2 = new GlideRecord('cmdb_ci_business_app');
grAppRole2.addQuery('name', appName2);
grAppRole2.setLimit(1);
grAppRole2.query();
if (grAppRole2.next()) {
result.roleDetails = grAppRole2.getValue('data_classification');
}
return JSON.stringify(result);
},
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2025 07:09 PM
Hello,
It is not working.
Script Include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 08:42 PM
Hi @purdue
Use getDisplayValue() method to reterieve the display value of Business Application field.
In case Business Application field is a reference field and you are trying to populate the field like data classification, cost center from Business Application record try using script include method.
Refer: https://www.servicenow.com/community/developer-forum/populate-logged-in-user-details-in-catalog-item...
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2025 06:23 PM
Hello,
Are you saying to use the getDisplayValue in the first line of the client script?
Thanks a bunch.
Chad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2025 07:08 PM
Hello,
It is not working.
Script Include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2025 02:59 AM - edited 01-26-2025 03:00 AM
Hello @purdue
Here is the updated script include:
getdataclassfication: function() {
var result = {};
var appName2 = this.getParameter('sysparm_appName');
var grAppRole2 = new GlideRecord('cmdb_ci_business_app');
grAppRole2.addQuery('name', appName2);
grAppRole2.setLimit(1);
grAppRole2.query();
if (grAppRole2.next()) {
result.roleDetails = grAppRole2.getValue('data_classification');
}
return JSON.stringify(result);
},
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"
Thank You
Juhi Poddar