- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 05:04 AM
As we know, to access server side value we use make use object "current" in Business Rule. Similarly can we use object "current" in "Script Include". If not what are other ways to access server side value in script include except "GlideRecord".
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 05:12 AM
As Mohith suggested above, to gain deeper understanding you can refer to below article:
Ref link:
Can Script Includes Use the "current" Variable?
The correct way to access the “current” object in a Script Include, is to pass it into the function you’re calling (and preferably, to use a variable name within the method other than “current”).
Note: Keep in mind that when handling objects in JavaScript, you’re passing by reference, not by value. This basically means that anything that you do to the object in the Script Include, will also happen to that object in the Business Rule - even if your SI method doesn’t return anything!
Since this is the “short” solution, I’ll spare you the explanation of pass-by-reference (PBR). If you want to know more about it - and you should - you can read more in my article on the subject, here.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 06:34 AM
Hi Aman,
So if we want to pass server side values to client script. Is it only possible by using gliderecord in scriptinclude and ajax in client script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 06:36 AM
Yes,
You can also use getReference to fetch values from reference field but that is not best practice and exposes data to illegal access
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 06:38 AM
Oh great!! thank you Aman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2022 05:23 AM
Hi,
Members have already mentioned the points.
What's your exact use-case where it's not working?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader