- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2019 03:32 AM
I need to pass a variable value which is declared in Client Script to Processing Script.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2019 05:22 AM
Hi,
So in your HTML, you'd want to put a hidden input like:
<input type="hidden" id="jvar_answer" name="jvar_answer" value=""/>
Then in your client script, set this id to a value:
gel('jvar_answer').value = "42";
In your processing script, you now get to refer to it as:
jvar_answer
Please mark reply as Helpful/Correct. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2023 04:44 AM
Above solution did not worked for me. Can you please help me out.
My use case is as below:
1. I have declared the Hidden variable similar to yours.
2. I have a processing script which is getting executed, but I need to check a certain value which I need to pass from my client script and then only Processing script should get executed.
Below is what I have tried. I am not sure what mistake I am making here:
HTML:
<input type="hidden" id="jvar_answer" name="jvar_answer" value=""/>
<g:dialog_buttons_ok_cancel ok_text="${gs.getMessage('Send')}" ok="actionOK();" cancel="return cancel();"/>
Client Script:
function actionOK() {
var getMessage = new GlideAjax('SI Name');
getMessage.addParam('sysparm_name', 'Method Name');
getMessage.addParam('sysparm_recordID', g_form.getUniqueValue());
getMessage.getXMLAnswer(getMessageInfo);
}
function getMessageInfo(answer) {
alert(answer); //getting the alert successfully here
if (answer != '') {
if (confirm(getMessage(answer)) == true) {
gel('jvar_answer').value = "confirmed";
} else {
gel('jvar_answer').value = "cancel";
}
}
}
Process Script:
gs.info("value of Hidden variable is " + jvar_answer);
I am getting the message as blank in the info statement put in processing script.
Regards,
Surbhi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2024 06:57 AM
Hi Surbhi
Did you ever get this to work as I am facing the same issue? If your script is working now, could you share your solution. Thanks!