- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2023 03:54 AM
Hey there,
I am trying to add filter to list widget, where on selecting of incident record, I will show that record in list widget. This works when I select a record for the first time[Image 1], but doesn't work if I select other record[Image 2].
I don't know if there is a limitation on calling 'widget-data-table' widget, as I have tried this approach with form widget and works perfectly fine.
I have checked that widget option is updated when server is called again. But, output of $sp.getWidget doesn't contain necessary data.
Image 1:
Image 2:
Thank!
Solved! Go to Solution.
- Labels:
-
Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2023 06:25 AM
I've noticed this happens with embedded widgets - they just don't refresh with the rest of the client data model the way you would expect. I usually have to play around quite a bit to get them working right, but try something like this:
Wrap your <sp-widget> inside of a div with an ng-if="wid.data.widgetInstance" condition.
Then, in your client script, at the start of $scope.callList, set $scope.wid = '';
This should have the effect of triggering the condition on the div to "destroy" the embedded widget when you select a new incident and then recreate it once you get the response.
Michael D. Jones
Proud member of the GlideFast Consulting Team!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2023 06:25 AM
I've noticed this happens with embedded widgets - they just don't refresh with the rest of the client data model the way you would expect. I usually have to play around quite a bit to get them working right, but try something like this:
Wrap your <sp-widget> inside of a div with an ng-if="wid.data.widgetInstance" condition.
Then, in your client script, at the start of $scope.callList, set $scope.wid = '';
This should have the effect of triggering the condition on the div to "destroy" the embedded widget when you select a new incident and then recreate it once you get the response.
Michael D. Jones
Proud member of the GlideFast Consulting Team!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2025 04:50 AM
Great answer! Specially the tip to wrap <sp-widget> inside a div with an ng-if condition.
Setting the ng-if within the <sp-widget> (<sp-widget ng-if="...">) does not destroy the widget!
THX