- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Team,
I am working on Service Operations Workspace (SOW) in the Australia release and would like to customize the Caller Card displayed in the Record Information sidebar.
Currently, the Caller Card shows:
- Caller Name
- Title
- Department
- Time Zone
Example:
My requirement is to replace the Time Zone field with a custom Site field Value from the User record .Priyanshu Anand
ServiceNow Developer - IT
02:43:23 America/Los_Angeles
Attaching image for reference -Documentation reviewed -
I have already reviewed the following ServiceNow documentation related to customizing the side panel:
The documentation explains how to configure and customize the side panel, but I could not find information on how the Caller Card fields are sourced or how to replace an existing field (such as Time Zone) with a custom field.
Any guidance, examples, or documentation references would be greatly appreciated.
Thanks,
Priyanshu Anand
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @PriyanshuA92384 ,
In my case, I replaced the Time Zone field with the User's Email field. Since you want to use a custom field, update the configuration with your custom field name.
1.Navigate to Script Includes and open the SOWIncidentInfo Script Include.
2.Update the script field with following script and save the record.
Replace the User Email field used in the script with your custom field name.
var SOWIncidentInfo = Class.create();
SOWIncidentInfo.prototype = Object.extendsObject(sn_sow_inc.SOWIncidentInfoSNC, {
getCallerInfo: function() {
var result = {};
var caller = {};
var callerRef;
if (this._gr.getTableName() == 'interaction')
callerRef = this._gr.opened_for.getRefRecord();
else
callerRef = this._gr.caller_id.getRefRecord();
caller.sysId = callerRef.getUniqueValue();
caller.avatar = callerRef.avatar ? "/" + callerRef.avatar + ".iix?t=small" : "";
if (this._gr.getTableName() == 'interaction')
caller.name = this._gr.getDisplayValue("opened_for");
else
caller.name = this._gr.getDisplayValue("caller_id");
// caller.timeZone = gs.getProperty('glide.sys.default.tz') || 'America/Los_Angeles';
// caller.timeZoneValue = gs.getProperty('glide.sys.default.tz') || 'America/Los_Angeles';
if (callerRef.title)
caller.title = callerRef.getDisplayValue("title");
if (callerRef.department)
caller.department = callerRef.getDisplayValue("department");
var locationRef = callerRef.location.getRefRecord();
if (locationRef && locationRef.city)
caller.city = locationRef.getDisplayValue("city");
// if (callerRef.time_zone) {
// caller.timeZone = callerRef.getDisplayValue("time_zone");
// caller.timeZoneValue = callerRef.getValue("time_zone");
// }
//Here repalce with your custom field
if(callerRef.email)
{
caller.email = callerRef.getDisplayValue("email");
}
if (callerRef.vip)
caller.vip = [{
"label": gs.getMessage("VIP"),
"color": "critical"
}];
result.caller = caller;
if (this._gr.getTableName() == 'interaction')
result.fieldsInfo = this.getFieldsInfo(this.FIELDS.SOURCE);
else
result.secondaryInfo = this.getFieldsInfo(this.FIELDS.SOURCE);
return result;
},
type: 'SOWIncidentInfo'
});
3.Navigate to UI builder and Under Page collections tab, Select SOW - sidebar tabs top
4.Now duplicate the page variant of Record Information SNC
5.Now make the Record Information SNC Variant Inactive(uncheck active) and click on save.
6.Open the Record Information SNC Copy in editor mode and in the client scripts open Set Record information primary details.
7.In the script comment out the 4 lines related to time zone and add the following script as shown in the image below and click on apply then Click on save .
if (api.data.record_information.output.sourceInfo.callerInfo.caller.email) {
subHeadingList.push(api.data.record_information.output.sourceInfo.callerInfo.caller.email);
}9.Final result: The Time Zone field is replaced with the User Email field.
10.Using the same approach, you can add any other required fields if needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
This is controlled within the UX Client Script 'Set Record information primary details'
Unfortunately it's not super "configurable" with the annoying complexities of UI Builder.
- The 'SOW Record Information' data broker is called
- SOWIncidentInfo is used to return the desired payload (you'd need to amend it here to return the needed information
- 'Set Record information primary details' would then need to be modified in order to take the provided payload and map your additional attribute / remove timezone information
With this, you'd have to create a new variant of the page 'Record Information SNC'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @PriyanshuA92384 ,
In my case, I replaced the Time Zone field with the User's Email field. Since you want to use a custom field, update the configuration with your custom field name.
1.Navigate to Script Includes and open the SOWIncidentInfo Script Include.
2.Update the script field with following script and save the record.
Replace the User Email field used in the script with your custom field name.
var SOWIncidentInfo = Class.create();
SOWIncidentInfo.prototype = Object.extendsObject(sn_sow_inc.SOWIncidentInfoSNC, {
getCallerInfo: function() {
var result = {};
var caller = {};
var callerRef;
if (this._gr.getTableName() == 'interaction')
callerRef = this._gr.opened_for.getRefRecord();
else
callerRef = this._gr.caller_id.getRefRecord();
caller.sysId = callerRef.getUniqueValue();
caller.avatar = callerRef.avatar ? "/" + callerRef.avatar + ".iix?t=small" : "";
if (this._gr.getTableName() == 'interaction')
caller.name = this._gr.getDisplayValue("opened_for");
else
caller.name = this._gr.getDisplayValue("caller_id");
// caller.timeZone = gs.getProperty('glide.sys.default.tz') || 'America/Los_Angeles';
// caller.timeZoneValue = gs.getProperty('glide.sys.default.tz') || 'America/Los_Angeles';
if (callerRef.title)
caller.title = callerRef.getDisplayValue("title");
if (callerRef.department)
caller.department = callerRef.getDisplayValue("department");
var locationRef = callerRef.location.getRefRecord();
if (locationRef && locationRef.city)
caller.city = locationRef.getDisplayValue("city");
// if (callerRef.time_zone) {
// caller.timeZone = callerRef.getDisplayValue("time_zone");
// caller.timeZoneValue = callerRef.getValue("time_zone");
// }
//Here repalce with your custom field
if(callerRef.email)
{
caller.email = callerRef.getDisplayValue("email");
}
if (callerRef.vip)
caller.vip = [{
"label": gs.getMessage("VIP"),
"color": "critical"
}];
result.caller = caller;
if (this._gr.getTableName() == 'interaction')
result.fieldsInfo = this.getFieldsInfo(this.FIELDS.SOURCE);
else
result.secondaryInfo = this.getFieldsInfo(this.FIELDS.SOURCE);
return result;
},
type: 'SOWIncidentInfo'
});
3.Navigate to UI builder and Under Page collections tab, Select SOW - sidebar tabs top
4.Now duplicate the page variant of Record Information SNC
5.Now make the Record Information SNC Variant Inactive(uncheck active) and click on save.
6.Open the Record Information SNC Copy in editor mode and in the client scripts open Set Record information primary details.
7.In the script comment out the 4 lines related to time zone and add the following script as shown in the image below and click on apply then Click on save .
if (api.data.record_information.output.sourceInfo.callerInfo.caller.email) {
subHeadingList.push(api.data.record_information.output.sourceInfo.callerInfo.caller.email);
}9.Final result: The Time Zone field is replaced with the User Email field.
10.Using the same approach, you can add any other required fields if needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @Rakesh_M
we have acheived for request also , thanks
For requested item (ritm) under related tabs of request -
Have to modify opened by and requested for of RITM -
can you please provide the same steps for that or any input
Thanks,
Priyanshu Anand