- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2025 08:00 AM - edited 07-14-2025 08:01 AM
Hi Community,
While exploring different ways to pass values from the server side to the client side in ServiceNow, I recently came across the use of putClientData() on the server side and getClientData() on the client side.
These methods seem to allow direct transfer of data between server and client without needing a separate GlideAjax call or getReference().
Given this capability, I'm curious — why are GlideAjax and getReference() still preferred or commonly used in practice over putClientData() / getClientData()?
Are there any limitations, best practice considerations, or disadvantages associated with the use of putClientData() that developers should be aware of?
Would love to hear your thoughts or real-world experiences.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2025 08:06 AM
data stored with putClientData() is stored in User' session and if we use it excessively it can lead to performance impact when more users are using that form.
Data stored in session might be risky.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2025 09:31 AM
@sndevastik I think they are best suited for passing a few small, simple server-side values during form load. It’s not ideal for large datasets or complex structures. In practice, I’ve seen it used typically for setting basic flags like 'isManager', 'hasSpecialRole', or for preloading simple lookups. However, in most real-world scoped applications or HRSD implementations, client-server interactions predominantly rely on GlideAjax due to its greater flexibility and dynamic capabilities.
Please mark correct/helpful if this helps you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2025 08:06 AM
data stored with putClientData() is stored in User' session and if we use it excessively it can lead to performance impact when more users are using that form.
Data stored in session might be risky.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2025 08:08 AM - edited 07-14-2025 08:09 AM
Hi @Ankur Bawiskar ,
Could you please elaborate more and provide some examples if possible when we should these methods and when not ?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2025 08:19 PM
I don't have a direct example, but this is based on my experience and knowledge and past discussion we had with ServiceNow support team.
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2025 09:31 AM
@sndevastik I think they are best suited for passing a few small, simple server-side values during form load. It’s not ideal for large datasets or complex structures. In practice, I’ve seen it used typically for setting basic flags like 'isManager', 'hasSpecialRole', or for preloading simple lookups. However, in most real-world scoped applications or HRSD implementations, client-server interactions predominantly rely on GlideAjax due to its greater flexibility and dynamic capabilities.
Please mark correct/helpful if this helps you!