Changing a client variable with JavaScript
Question
Application Type
Reactive

I have a script, (not javascript that's being called on an action.)

This script I link to my screen.
When this script gets triggered, I want it to change my client variable.
How do I call a client variable in my script? Or even if I can call a client action on my script.
(not calling it on javascript in an action).
How can this be done?

Can you use the output variable then assign it to the client variable after the javascript node.

This is unfortunately javascript within an action. I wish to have it in the script that I add to the screen.

mvp_badge
MVP

Hi Divan,

I don't think so you can call client variable it in script file.

you need to use javascript action and use output parameter for it.

also you can this one -

if (typeof(Storage) !== "undefined") {

  // Store

  localStorage.setItem("MyClient", "Smith");

  // Retrieve

 console.log(localStorage.getItem("MyClient"));

} else {

  console.log("Sorry, your browser does not support Web Storage...");

}


Hope this will help you.

Regards

Rahul

Hi ,

you can bind client variable in one input widget and set this input as display none by CSS.

on script you can change value by input widget like -

document.getElementById('InputID').value='MyVal';


Hope this will hwep you.

Regards

Deepa

I have 2 solutions for this issue so you can check my oml file 

test3.oml

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.