Catalog Item Requirement

purdue
Kilo Sage

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')

Screenshot 2025-01-23 at 5.30.32 PM.png

Thanks,

Chad

1 ACCEPTED SOLUTION

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

 

View solution in original post

12 REPLIES 12

Hello,

Unfortunately this does not work nothing is populated.  Any other ideas?

Thanks,
Chad

Hello,

I decided to switch to a select box and it works.

Thanks,

Chad

yuvarajkate
Giga Guru

use getDisplayValue() function to retrieve the Display value instead of the value, use a variable to store it and then use setValue()function to set the display value using that variable.