Employee Information Component - Agent Workspace for HR Case Management (Fields displaying sys_id)

Dario Idrovo1
Tera Contributor

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. 

 

DarioIdrovo1_0-1670428591740.png

 

Below is the script for this component widget:

 

DarioIdrovo1_0-1670429192125.png

 

 

#agentworspace #hrsd #uibuilder #components

1 ACCEPTED SOLUTION

JagjeetSingh
Kilo Sage
Kilo Sage

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.

 

JagjeetSingh3_1-1670752403475.png

 

 

 

Jagjeet Singh
ServiceNow Community Rising Star 2022/2023

View solution in original post

6 REPLIES 6

Verify if you are in correct scope.

Also, if you see that page is read only then you have to create a variant and make changes there.

 

Jagjeet Singh
ServiceNow Community Rising Star 2022/2023

Hi Jagajeet, how to add extra fields to employee information?

I see employee fields section but how do I add? any format and procedure.

I am very new to this, please help.