
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2020 01:13 PM
Is there a way so that we can use g_scratchpad variable in catalog client scripts.
Or we only have GlideAjax for fetching server side data on catalog client scripts.
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2020 09:46 PM
Hello Sachin,
No we cant use g_scratchpad variable in this case.
scratchpad is a data holder which is on server and client side
Server - Display Business Rule to put data in scratch pad
Client - Read data from scratch pad and use it
https://docs.servicenow.com/bundle/madrid-application-development/page/script/business-rules/concept/c_ScriptingWithDisplayBusinessRules.html
For catalog item form or record producer you should make a GlideAjax call via client script.
Please mark as Correct Answer and Helpful, if applicable.
Thank You!
Abhishek Gardade
Abhishek Gardade

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2020 01:25 PM
Are you trying to use it to be referenced in a later client script? If so, probably not as it gets cleared out. If you're trying to use an onDisplay business rule and pass information to the client, then yes you should be able to do this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2020 09:33 PM
Hi,
Generally g_scratchpad is available on client side only when Display Business Rules are used. If your requirement is to fetch data based on some other action like OnChange, then you have to use Script Include.
Let us know your requirement and may be we can assist you better.
Mark the comment as a correct answer and helpful if this answers your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2020 09:41 PM
g_scratchpad is an empty/temporary object you can use to push information (properties, objects, functions, custom variables etc.) from the server to the client.
Note:- that information is not available currently on the form
Is run on catalog item tables(s c_cart_item, sc_cat_item) ? --> You cannot run business rules on catalog items. Hence we cant use g_scratchpad to set values.
Mark the comment as a correct answer and helpful if this answer suffice your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2020 09:46 PM
Hello Sachin,
No we cant use g_scratchpad variable in this case.
scratchpad is a data holder which is on server and client side
Server - Display Business Rule to put data in scratch pad
Client - Read data from scratch pad and use it
https://docs.servicenow.com/bundle/madrid-application-development/page/script/business-rules/concept/c_ScriptingWithDisplayBusinessRules.html
For catalog item form or record producer you should make a GlideAjax call via client script.
Please mark as Correct Answer and Helpful, if applicable.
Thank You!
Abhishek Gardade
Abhishek Gardade