- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2018 08:43 AM
I have a breakdown script that is getting the a list of users, displaying the user name and their user ID. I want to display it by a different field stored on the user table. However, the breakdown continues to show it as the full name. The breakdown mapping for this script is using the other field. Any ideas why this wouldn't work? Thanks.
var users= [];
var manager = current.taskslatable_team.manager.getRefRecord();
if (manager != null && manager.u_include == true) {
users.push(manager.getValue('u_name'));
}
users;
Solved! Go to Solution.
- Labels:
-
Performance Analytics
-
Reporting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2018 08:33 AM
I wrote a long lovely post on this and the new Community system lost it when I went to get the link at the end. 😛 My apologies.
If you're just trying to change the Display value for the breakdowns, the way Automated Breakdowns works, you're stuck with the display value for the table. So you've got two possibilities:
1. Change the display value for the sys_user table. Usually you can't do this, because it impacts every other table in the system, and potentially some integrations as well if they depend on the Display Value. It's worth investigating though if the Assigned To field on the tickets for example isn't useful and you'd rather have this other value instead, but test thoroughly!
2. A scripted breakdown or "Breakdown Sandwich". We generally don't recommend them because of the complexity and potential overhead, but in some cases it's the only way to meet the business objective. Mainly it's used in situations where the thing you want to breakdown by isn't a Choice or Reference field, but the way it operates has the byproduct of allowing you to choose the Display field you want to use. The way it works is you're building a manual breakdown, which you then populate using a scheduled job. The values you put into the manual breakdowns in that table become your Display values. Then you build a Breakdown Source against pa_manual_breakdowns where the Breakdown = (the manual breakdown you just built) and an Automated Breakdown against that. The Breakdown Mapping will use a script, so that it can take the current user value in your case, and find the pa_manual_breakdown with the value you want to match, and return that sys_id. Now the sys_id refers to a table where the Display value is the one you set.
Here's more information on that:
https://community.servicenow.com/community?id=community_question&sys_id=7dd0cf65db98dbc01dcaf3231f96194d
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2018 08:53 AM
Breakdowns must always result in a sys_id (or array of sys_ids). Change
users.push(manager.getValue('u_name'));
to
users.push(manager.getValue('sys_id'));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2018 09:53 AM
Hi Adam,
You're responding to all my questions 🙂 Thanks!! That didn't work. I want that specific field to dispaly (u_name). How else can I do that? Do i need to do something further into the script?
So instead of "John Doe (JohnDoeUserID)", I want "John Doe" << The value of the u_name field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2018 09:56 AM
Hi,
Use getDisplayValue
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2018 10:36 AM
That didn't seem to work either. Is it something with the fields selected above the script that need to change?