Script Include not getting executed in "Data Table from Instance Definition" widget instance filter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago - last edited 4 hours ago
Hi Team,
I am working with the Data Table from Instance Definition widget in Service Portal.
In the Widget Instance configuration, I am trying to use a Script Include in the Filter field, as shown in the screenshot below.
Example:
Store is one of javascript:new global.MyHeroLetters().getStoresForCurrentUser();However, the Script Include is never executed. I added gs.log() statements inside the method, but no logs are generated, indicating that the Script Include is not being invoked.
The Script Include is active and accessible, and the method returns a comma-separated list of sys_ids.
Could anyone clarify:
- Does the Filter field of the Data Table from Instance Definition widget support javascript: expressions?
- If not, what is the recommended approach for applying a dynamic filter based on the current user?
Script Include is as follows:
Any guidance would be appreciated.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Can you confirm whether your cloned/custom widget is triggering properly.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
33m ago
yes, widget is triggering properly @Tanushree Maiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hello @Sachin Gavhane ,
can you confirm that the filter field can call script Includes ?
Because as far as I know the javascript: expressions in that filter field only work with client accessible objects like g_user.userID, g_user.name, etc. They cannot call Script Includes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
30m ago
Neither I am sure whether filter can call script include @yashkamde
Kindly help me with other approach incase if SI is not possible here in the filter
Thanks !