Jon G Lind
ServiceNow Employee
ServiceNow Employee

NOTE: As of this writing this topic applies to Rome, San Diego and Tokyo.

This quick article will explain how to customize the cards that are prolific in the ServiceNow Digital Portfolio Management Workspace as well as show you how to take control of the data that is returned to the UI through Transform Data Resources. 

Quick background--Digital Portfolio Management allows you to create your "personal" portfolio of services and assets or browse shared "enterprise" portfolios in a single workspace to avoid having to jump from application to application.

 

The workspace (path is /now/dpm/home) is nominally configurable with UI Builder, but since the core pages are locked it takes a little teasing to find the proper places where you can modify the content of the cards.

NOTE: When navigating these tables in this example it is simplest to filter where Application = Digital Portfolio Management.

 

(Mostly) Not in the EVAM Config Tables

Yes, these are EVAM cards.  You would expect them to be configured in the EVAM modules in UI16, but you would (mostly) be wrong.  There are a couple of cards related to modifying who can view your personal portfolios there, but the rest of the cards are rendered and configured in a UX Client Script Include.

 

DPMClientUtils UX Client Script Include

 Find the DPMClientUtils Sys UX Client Script include in sys_ux_client_script_include table.  Unlike the page layouts that are part of the default workspace this record is editable.

  1. For example, you will see that when getPersonalPortfolioCards is called it specifies to use the default “now-card-evam-record”.  This card is pretty standard with a title, subtitle avatars and a spot for details 1, 2, 3, etc.  It should be useful 90% of the time.
  2. It then calls buildPersonalPortfolioCardProps.  There you will see that it maps the DPM values AND labels to the default fields (titleLabel, detailValueOne, etc.)
  3. If you want to change the card you change the mappings here.  A few of the others I checked have similar script (e.g. “buildOutageCard”).
  4. If you want to make a new template you can follow these instructions from Brad Tilton. It will take a bit of work, but you would then specify your custom template instead of “now-card-evam-record” and supply your own mappings.  IMO this really should not be necessary.
  5. Unfortunately certain behaviors, such as sorting and limiting the number of results to three on the home page is controlled in script attached to the page definition and cannot be edited.
  6.  

Server Side Scripts and Data

Really, most anything that you would need to do can is in DPMClientUtils.  However, if you need to modify or add to the data that is returned to those client scripts you have options.

 

Data Resources Are Not Locked

Similar to the fact that the DPMClientUtils is not locked from editing, so too are the data resources free for editing.  Most of these are Transform data resources and you may access them by simply  clicking the "up-and-away" box icon on the data resource pill.

DPM View Data Resource.jpg

 

NOTE: Editing these data resources for a component or page that you cannot edit will be mostly pointless and could break something.  Be careful!  For the purposes of this document only use it if you wanted to change the data rendered on the personal or enterprise portfolio cards.

 

DPMUtils Server Side Script Include IS Locked

As you will see, the script DPMUtils, which is used extensively to retrieve data from the server from within data resources, is protected.  However, all it does is inherit from DPMUtilsSNC and you can too!

  1. Make a copy of DPMUtils in the same scope and call it DPMUtils2 (or whatever you would like). NOTE: Do NOT use Insert and Stay--this will create another locked version of the script.  Instead just copy and paste the code into a new record in the DPM scope and change the class names like this to be "DPMUtils2" (or whatever you prefer):
    new script.jpg
  2. Don't mess with the existing calls to "DPMUtils" from other areas of the code until you need to (i.e., don't got back and change everything everywhere if you're only editing one of the calls for one of the portfolios).
  3. When you need to do something custom, such as tweak the values returned form a method like "getAllPersonalPortfoliosForUser" just copy it from the "DPMUtilsSNC" base class and make your tweaks.
  4. Here I am overriding that method to add "hello world" to the results (note a real-world example, but you get the idea).
    DPM Override Method.jpg
  5. Go back to your Transform Data Resource (in this case "Get personal portfolios") and replace the call to DPMUtils with DPMUtils2.

 

Conclusion

There are a lot of things that you can modify in the Digital Portfolio Management workspace, but it's not always obvious how to do so.  And there are things (such as the content on the detail pages that are not using EVAM cards) which you cannot access directly.  Using these techniques, though, you will be able to take control of your data.

 

Appendix: Helpers

Plain Text Scripts

When navigating the Sys UX tables that make up the core of Next Experience you will frequently encounter script fields that are rendered as plain-text.  If you are not already doing so get Arnoud Koois' SNUtils browser plugin.  This adds a little </> link next to the script fields that will open up a nice editor. (It does a lot of other useful things too!)

Test Scoped Code

When you create your own DPMUtils script you will want to be able to unit test it without having to go through the application.  The Xplore Toolkit will allow you to execute test scripts within the Digital Portfolio Management scope.

Just Plain Old Help With Next Experience

Don't miss the Next Experience Center of Excellence for more details and deep-dives for Next Experience and UIB.

Comments
GMunee
Tera Contributor

I'm looking to do a few thing that I could use some guidance on....

  1. Add action buttons to approve demands, and add related links typically found on demand planning console.
  2. Customize filters on the build tab of Business applications
  3. add / remove widgets to business application performance pages
Yamilla Manjko
Tera Guru

How can I make changes to DPM queries? If I wanted to change the table where the data is being pulled from or the query that is being used for example on the "Epics in backlog that are ready" item on the Build tab, what I would need to do?

To be honest I have found no documentation or guidelines regarding this matter, only about configuration like hiding tabs or section.

YamillaManjko_1-1732900096150.png

 

Version history
Last update:
‎10-17-2022 09:32 AM
Updated by:
Contributors