Button to interact with Global variables

Quick question:

If I want to have a button to interact with a global variable in a page, is there any way to do it?
For example, I’d like to have a variable named Timer Started, which is default to be false; then I want the button to alter that value to true; and logging timestamp in another variable. You get the idea.

I’m aware of a data table way to implement this. But sometimes I don’t care about logging each entry, rather I just want the button to interact with some temporary dummy variables in order to achieve some simple functionalities.

Is there any ways to do it?
Thanks

Hello @Chen_Zhong!
For that you would have to use controls, in your case a checkbox control and a Date and Time control.

First you create the control
Create a checkbox control

And, in the button you select set control value to change the controls you want to modify.

Set a control with button

I hope this helps!

5 Likes

Thanks a ton!
So it seems I misunderstood Control Value… it has to be a checkbox, slider, i.e. something we can interact with, right?
Please correct me if I’m wrong.

1 Like

Hi @Chen_Zhong :blush: ,

No, you’re not wrong … (Canvas) Controls are effectively Checkboxes/Toggles, sliders, etc… which we can interact with and modify using a button with SetControlValue() :blush: … As @Saul_Garcia suggested :blush: .

2 Likes

I see. Gotcha. Thanks!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.