Embedding multiple 'report' widgets does not work when using the sp-widget directive and $sp.getWidget. The provided widget can only be used once on any Service Portal Page.


Steps to Reproduce


1. Create a widget to add multiple embedded 'report' widgets in.

2. In the Body HTML template, use the sp-widget directive like:
<sp-widget widget="data.incidentReport">

3. Pass values to reference a Report record like so in the Server script field:
var incidentReportOptions = {
"report_id": "053275cf470111002ee987e8dee490ce",
"rectangle_id": "incidentGraphReport",
"widget_parameters" : "{ \"report_id\": {\"value\": \"053275cf470111002ee987e8dee490ce\",\"displayValue\": \"Open Incidents by Assignment\"},\"show_title\": {\"value\": \"true\",\"displayValue\": \"true\"}}"

data.incidentReport = $sp.getWidget('report', incidentReportOptions);

3. Repeat steps 2 and 3 but for another report, for example in the Body HTML template:
<sp-widget widget="data.problemReport">

Server script:
var problemReportOptions = {
"report_id": "a1c6198f470111002ee987e8dee4900b",
"rectangle_id": "problemGraphReport",
"widget_parameters" : "{ \"report_id\": {\"value\": \"a1c6198f470111002ee987e8dee4900b\",\"displayValue\": \"Problems By State\"},\"show_title\": {\"value\": \"true\",\"displayValue\": \"true\"}}"

data.problemReport = $sp.getWidget('report', problemReportOptions);

4. Add the widget to an empty portal page.

5. View the page and notice only the last embedded widget to be called displays its report, but it displays under the header/title for the first embedded widget to be called. The header/title for the last embedded widget shows the message "Building chart, please wait...". The first report can be seen briefly when initially loading the page in its expected place underneath its title/header, but is quickly replaced with the last embedded widget to be called.


This problem is targeted to be fixed in a future release.

Related Problem: PRB1298794

Seen In

There is no data to report.

Fixed In


Associated Community Threads

There is no data to report.

Article Information

Last Updated:2019-05-21 11:40:53