- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 07:58 AM - edited 12-07-2022 08:06 AM
Hello,
With the new UIB for Agent Workspace for HR Case Management we needed to change what displays out of the box under the Employee Information component within the case creation UI page (not Legacy or native view).
We made the changes to the script and called it into the component, however all reference fields are displaying the sys_id instead of the string value. Again, please note that this has nothing to do with the legacy or native view case creation configuration page. This UIB is different, this is for the new Agent Workspace for HR which is configurable through the UI Builder.
Below is the script for this component widget:
#agentworspace #hrsd #uibuilder #components
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2022 01:53 AM
Hi Dario,
I investigated on this one. The data broker uses "hr_CaseCreateSearchWsSNC" script include and in that below function is being used to fetch the field values.
_fillContactField: function(fieldElem, fieldName) {
var currField = {};
currField.id = fieldName;
currField.label = fieldElem.getLabel();
currField.value = fieldElem.toString();
currField.clickable = false;
return currField;
},
You need to extend this script include and override this function. Instead of fieldElem.toString(), I'd suggest to use fieldElem.getDisplayValue(). That would solve your issue.
Now, Another suggestion here is that you should leave the OOTB data source as it is and pass on additional fields from UI builder where it is used. To navigate there open UI builder > HR Agent Workspace > Case Creation Page > In data sources you'll find "Case Create - Get Employee Information". You can add your additional fields there in "Employee Fields" property. Best way is that you bind it with state parameter.
ServiceNow Community Rising Star 2022/2023

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 08:20 AM
Hello,
I don't know if this will work but for reference field you can use getDisplayValue() like below
user.location.getDisplayValue()
Try this.
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 08:54 AM - edited 12-07-2022 09:04 AM
I also tried this myself and unfortunately, it doesn't pull the display value and continues to pull the sys_id.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2022 01:53 AM
Hi Dario,
I investigated on this one. The data broker uses "hr_CaseCreateSearchWsSNC" script include and in that below function is being used to fetch the field values.
_fillContactField: function(fieldElem, fieldName) {
var currField = {};
currField.id = fieldName;
currField.label = fieldElem.getLabel();
currField.value = fieldElem.toString();
currField.clickable = false;
return currField;
},
You need to extend this script include and override this function. Instead of fieldElem.toString(), I'd suggest to use fieldElem.getDisplayValue(). That would solve your issue.
Now, Another suggestion here is that you should leave the OOTB data source as it is and pass on additional fields from UI builder where it is used. To navigate there open UI builder > HR Agent Workspace > Case Creation Page > In data sources you'll find "Case Create - Get Employee Information". You can add your additional fields there in "Employee Fields" property. Best way is that you bind it with state parameter.
ServiceNow Community Rising Star 2022/2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2022 08:23 AM
How can I update the Employee Fields directly in the UI builder? When I click on the data icon next to it, it doesn't allow me to make any changes, could you please provide further help with your suggestion?