How to show the output of a script include in service portal page?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2018 09:00 PM
Hi,
I have written a script to show the total count of searches with zero result from text_search table. I need to display this count on a service portal page. When i tried including that script on the server side of the widget, page reloading was delayed.
Please help me in showing this count on the page without causing issues in portal page reloading.
Thanks,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2018 04:14 PM
I am assuming you have your query built in a script include. you can call that script from the portal and store it in a variable like 'data.result', then display that on the HTML side using {{data.result}}.
If it takes a while to run that query, then I could see how your performance would be impacted... Do you need the result to be real time? what if you ran the query a few times a day using a scheduled job and stored the result in a separate, easy to access table?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2018 07:02 AM
Hi snowgopi,
Go through below link, Surely it will help you..:)
https://community.servicenow.com/community?id=community_question&sys_id=c44a07a9db5cdbc01dcaf3231f961941
https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/build/service-portal/concept/unsupported_client_scripts.html
Regrds,
Ashvini.kadus
Kindly Mark helpful/correct if i solved your query.