How to add multiple widgets in single widget?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2020 01:16 AM
Hi Team,
I am not able to add multiple widgets in a single widget while creating the dashboard. Could you please help me out.
Thanks & Regards,
Prabhakar
15 REPLIES 15
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2022 12:20 PM
As documented here: https://docs.servicenow.com/en-US/bundle/sandiego-servicenow-platform/page/build/service-portal/concept/c_NestedWidgets.html
Server Script:
var options = [
{zone: "America/Los_Angeles", title: "San Diego"},
{zone: "America/Denver", title: "Denver"},
{zone: "America/Chicago", title: "Chicago"},
{zone: "America/New_York", title: "New York"}
];
data.clocks = [];
for (var i in options) {
data.clocks.push($sp.getWidget("widget-cool-clock", options[i]));
}
HTML:
<div ng-repeat="myClock in c.data.clocks">
<sp-widget widget="myClock"></sp-widget>
</div>
Be sure to add option schema to the widget you want to have multiples of, so you can feed it unique data.