- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 07:31 AM
Hello Everyone,
We have a requirement to optimize a page in Service Portal. Currently, all widgets are performing the same queries but each of the widget are performing gliderecord in the Server Script. We want to have the gliderecord in only 1 widget (Widget 1) and call or use the data from Widget 1 to use it on other Widgets (Widget 1, Widget 2, etc.).
Regards,
Diane
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2023 06:41 AM - edited 09-19-2023 06:46 AM
Hi @dianemiro,
Good point, I was investigating and found a different option:
This way in your first widget you can make the queries on the Server Side and use Local Storage as it gets saved on the user session and on the other widgets you can just use session.getClientData(object, param2), and all your data saved will be accessible. It solved a lot of performance issues in a particular use case that I had.
As per your question, broadcast does expect something to trigger an event so it can replicate data to another widget that is listening - but it can be tricky and you can maybe try this:
Angular run function on broadcast and page load
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-20-2023 06:43 AM - edited 09-20-2023 06:45 AM
Hello @Marcos Kassak,
I've tried this and put in something like this:
Widget 1
Server Script:
var session = gs.getSession();
session.putClientData('cService', data.service);
Widget 2
Server Script:
var session = gs.getSession();
data.clientService = session.getClientData('cService');
I'm trying to display this Service on my HTML Template using:
<div class="panel panel-success" ng-if="data.clientService">{{data.clientService}}</div>
But it displays nothing. May I know how can I display this on HTML Template correctly? Thank you!
Regards,
Diane