Configurable Portal Widgets - How to pull sys_id?

Mike Sabia1
Tera Expert

1)  For the Portal Object Widget, THIS page says for the Record option, "If this field is empty, the widget displays information based on the sys_id parameter provided in the portal web page URL." but if I leave the field blank, it shows and uses the default example from the alm_asset table.  How do I get it to pull the sys_id from the URL?

2) For the Portal Data List Widget, it works great for just providing a list such as replacing the default list widget on (a clone of) the my_projects page (which comes with the 'Customer Project Management'/sn_csm_ppm plugin).  However, can this be used on a Record Page to show sub lists?  If I place it on (a clone of) the project_detail page, a) it doesn't pick up the project record and rather than showing the Contacts for that Customer Project, it instead shows all Contacts.  (As well, if I click on a Category, the URL loses the sys_id shown before I select a Category) How can I get it to filter?  THIS page doesn't give options on the query line

I've tested with Vancouver Patch 6 and Washington Patch 0 and the latest version 3.3 of the 'UI Components for Customer Portals' plugin

Thanks!!

2 ACCEPTED SOLUTIONS

You'd need to modify the widget and put it in the Server Script field, entering it in the field like that won't work.  Then from the server script pass it to the client controller or HTML template.

Something similar to the below to pass the data.  

Server Script:  
var id = $sp.getParameter('sys_id');

Client Controller:
c.id = $scope.data.id

HTML Template:
{{c.id}}

View solution in original post

ServiceNow responded:

#1 is a known bug which they are working on

#2 is an enhancement on their roadmap

Based on this, I am accepting previous suggestion

Changes made to Server Script of Portal Object widget

    //var sysId = options.record_sysid || $sp.getParameter('sys_id');
    var sysId = $sp.getParameter('sys_id');

View solution in original post

10 REPLIES 10

ServiceNow responded:

#1 is a known bug which they are working on

#2 is an enhancement on their roadmap

Based on this, I am accepting previous suggestion

Changes made to Server Script of Portal Object widget

    //var sysId = options.record_sysid || $sp.getParameter('sys_id');
    var sysId = $sp.getParameter('sys_id');

FYI: My issues with #1 and #2 above are resolved with the 3.4.1 release of the plugin.  

How to pull sys_id  of the corresponding Business Application in the widget if its not available on the url

how to get sys_id in the widgets if it is not present on the URL

 

If it's not in the URL, what is the use case?
If it is in the URL, you could do something like the following:

"query": "active=true^state=-8^project={sys_id}"