Add a widget to the investment portal

Add a widget to the investment portal

25-09-2019

The investment portal is a powerful tool for PPM users to quickly create their own list of projects and demands for further analysis and tracking. During PPM implementation, it is a common request from customers to add additional widgets in the Investment portal.

Read more

ServiceNow has made it very easy to do so. Follow the below steps to learn how:

Use Case: Customers want to track benefit cost for projects and demand in the investment portal.

All the scripts used for the below examples can be found here

Steps:

1.       Navigate to Project Administration à Investment Portal Widgets and click New.

2.       Add the following fields.

 screenshot-1.png

3.       Click Submit

The total benefit cannot be calculated using other aggregated type, so this will be Scripted. It is also advisable to check the configuration of the OOTB widgets. Below are the some of the things to consider in the widget script. They are important and should be used in the scripts.

1. This script will return a string which is to be displayed on the widget. 

2. Inputs provided to API : 

  • projectFilter: the project filter of the Portal board for which widget value is being calculated 
  • demandFilter: the demand filter of the Portal board for which widget value is being calculated 
  • projectClass: the project table of the Portal board for which widget value is being calculated to support teamspaces/extended tables
  • demandClass: the demand table of the Portal board for which widget value is being calculated to support teamspaces/extended tables

3.        Output expected from API: 

  • Only string value is expected as the output.
  • The script must follow the previously explained format and the return value should be string (inside double quotes or single quotes)

 

Open an investment portal view and the new Widget will be visible by default – because we have checked the option ‘Include by default’ for the widget. Uncheck the option if you don’t want to include the new widget to the investment views by default.

 screenshot-2.png

 

The next step is to show the benefit for projects and demand. We will create 2 child widgets for the Benefit widget. We can do that from the Portal board Widgets related list (click New) of the Benefits widget or from the normal widget list page itself by selecting the Benefit widget as the parent.

Project Benefit:

screenshot-3.png

Demand Benefit:

screenshot-4.png

The changes can now be seen in the Investment Portal view. Because the Demand and Project Benefit are the children to the Benefit widget, they appear below the main widget. Notice that the order value of the Project and Demand Benefit widget will affect the order in which they appear in the portal.

screenshot-5.png