How to show the output of a script include in service portal page?

Gopi22
Giga Guru

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

2 REPLIES 2

Inactive_Us1180
Kilo Guru

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? 

Ashvini Kadus1
Kilo Guru

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.