ToolJet icon indicating copy to clipboard operation
ToolJet copied to clipboard

Data is not immediately available after running "set variable" in runjs

Open bestpika opened this issue 3 years ago • 3 comments

Version Information

Environment

  • ToolJet | v1.26.1 (docker)

What is the expected behaviour?

Use actions.setVariable to set the global variable and then read variables to get the data.

What is the current behaviour?

I got undefined.

How to reproduce the issue?

  1. Reload page.
  2. Execute the following runjs code.
actions.setVariable('t', 'yes');
alert(variables.t);

Screenshots or Screencast

image

Please provide any traces or logs that could help here.

Any possible solutions?

Can you identify the location in the driver source code where the problem exists?

If the bug is confirmed, would you be willing to submit a PR?

bestpika avatar Oct 07 '22 08:10 bestpika

Hey @bestpika , this seems to be a valid bug that needs to be fixed. We'll get to it as soon as possible.

sherfin94 avatar Oct 12 '22 08:10 sherfin94

I got a error running online

Running this in preview mode image

i got this error image

this error not hapen if i click in preview button , see .. image

ricardojlrufino avatar Oct 27 '22 01:10 ricardojlrufino

PS: Similar to this: https://github.com/ToolJet/ToolJet/issues/4444

ricardojlrufino avatar Oct 27 '22 01:10 ricardojlrufino

@ricardojlrufino The change in number #4445 (#4444) did not fix my problem. I am now running a docker image of v1.28.4. I still get the same result by running the code I provided above.

bestpika avatar Nov 17 '22 03:11 bestpika

I am getting the same issue! Tooljet version: tooljet/tooljet-ce:v2.5.0

Bhautik0110 avatar Jun 06 '23 10:06 Bhautik0110

Ref - #8242

kavinvenkatachalam avatar Jan 24 '24 03:01 kavinvenkatachalam