Data transfer from client script to server script in action type (sn_ex_sp_action_type)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 06:07 AM
Hi,
I am writing an action type that stores in "sn_ex_sp_action_type" table. I have a variable in client script that I need in server script to process update on record. Any idea how can we get it?
Regards,
Faizan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 06:39 AM
Hi,
You can call a server side script (script include) form client script using glide ajax and pass the value as an argument
Check the example here -> GlideAjax Example Cheat Sheet (UPDATED) - ServiceNow Community
sysparm_buildingid is the value being passed form client script to script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2024 07:06 AM
Hi Anurag,
Yes, it is one option but I am looking if we have any specific way like we have in portal widgets to transfer data from client to Server.
Regards,
Faizan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2025 12:27 PM
Hi @faizanhasib , how are you?
If you want to pass a value that is in the client script to the server script, just create a variable "answer" and call it in the server script as clientScriptOutput
Example:
If my answer helped you, please mark my answer as helpful.
Vanderlei Catione Junior | LinkedIn
Senior ServicePortal Developer / Technical Architect at The Cloud People