Hello,
I created a low-code app that contains two buttons.
Each button triggers a different automation script.
My problem is this:
How can I store the output of the first automation script inside the low-code app and then read that stored value from the second automation script?
I already created a variable using the low-code app variable menu.
In the button settings, I used the Change Variable action and linked it to an output window to verify that the value is being updated correctly.
However, I'm not sure how to make script 2 read the saved output from script 1.
In the 1st automation script:
engine.AddScriptOutput("json_buffer", response);
In the 2nd automation script:
string json_buffer = engine.GetScriptParam("json_buffer").Value;
json_buffer is always null
Thank you for help
Hi Ömer,
You can add script input parameters linked to feeds to pass data to a script:
- Add a Parameter to the script in the Automation module in Cube.
- Open the 'On click' event config of the second button.
- Open the 'Execute a script' action that should already configured. Now a 'Parameters' section should be available.
- Link the variable that contains the saved output of the first script to the input you created.
- In the second script, you can access the input argument by name via engine.GetScriptParam("Param name")
Feel free to ask more specific information is something is unclear.
*after refreshing the page the wrong paramter got deleted
Hi Ömer, scripts are cached when using Low Code Apps. If something in the script changes (except the actual code itself), you might need to refresh the webpage before it is updated. This could explain what you have noticed with the updated inputs. Unfortunately script parameters cannot be defined in the script code itself.
okay thanks you very much
your 5 points worked for me
Thanks. By mistake I created a parameter in the wrong script in the DataMiner cube and although I deleted it, the script still asks for that parameter.
In the first script (the correct one), I created the parameter, but it does not show up in the Low Code Apps button settings.
Is there another way to create the parameter directly with the script? Whenever I publish the script via Visual Studio, the parameter gets deleted and I always need to add it again in the cube.