How can i initialize random value instead of static value?

I want to show random data, but if i initialize random_num to zero, Every time i open the page it is showing first element, then when i click button its showing random data.

How can i achieve this??


if you are using ‚Äúset page variable‚ÄĚ flow function in the logic of the Button, move it to the logic of the page instead, and bind it to ‚Äúpage mounted‚ÄĚ or ‚Äúpage focus‚ÄĚ events.

1 Like

Thanks you sir, its working, This solution also helped me. How do I set Page variable from DB when page mounted