- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2017 03:36 AM
Client side:
Server side:
i am getting the values from array in html but I want to use it in client script.
I want to send the values which are in while loop of gliderecord and need to retrieve it in client script. Please help me in both - sending and retrieving. Many thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2017 05:15 AM
The common practice is to use the data object (noted in the comments) in your server script.
Example:
data.myNumber = 10;
data.myID = gs.getUserID();
Then in the client script,
var userID = c.data.myID;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2017 04:03 AM
Read up about g_scratchpad or Script Includes - they'll be what you're after.
For the latter, you'll pass the information as serialised fields in a JSON object then will need to de-serialise at the other end.
(we actually do this as a lab on our Scripting Course).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2017 04:18 AM
It's Service portal and not normal modules of Servicenow.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2017 05:08 AM
Hi Saurabh,
You can use the data object into the client part of your widget with c.data.variableName
Regards!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2017 05:15 AM
The common practice is to use the data object (noted in the comments) in your server script.
Example:
data.myNumber = 10;
data.myID = gs.getUserID();
Then in the client script,
var userID = c.data.myID;