Data transfer from client script to server script in action type (sn_ex_sp_action_type)

faizanhasib
Tera Contributor

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

3 REPLIES 3

Anurag Tripathi
Mega Patron
Mega Patron

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

-Anurag

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

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:

Vanderlei_0-1737145523937.png

Vanderlei_2-1737145600679.pngVanderlei_3-1737145626019.png

 

If my answer helped you, please mark my answer as helpful.

 

Vanderlei Catione Junior | LinkedIn

Senior ServicePortal Developer / Technical Architect at The Cloud People