how to load and call the javascript file into servicenow business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2017 01:58 AM
Hi ,
From My Application I have written 3 JavaScripts files which used to call a Rest API.
I wanted to call the same Rest API from ServiceNow Through Some Business Rules so that I dont have to write the Code again.
What is the way to use the same javascripts file in my Business Rules.
Thanks and Regards,
Subrata
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2017 03:39 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2017 05:53 PM
JS files and Busines Rule 'JavaScript' are two very different things.
JS files are client-side JavaScript, used to manipulate HTML pages, which is run from within a web browser.
Business Rules are run server side, which uses ServiceNow's Server Side API, that uses the same syntax as JavaScript.
While most (not all) JavaScript objects and methods are available in Business Rules, you do not have access to the DOM (ie window, document) as it is not run on a page.
All code is interpreted and executed as Java on the Server.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2024 03:56 AM
Thank you but what is the solution now? We need to run the javascript within the client side browser.