How to place code that you want to automatically initiate

I want to automatically initiate some code when the user starts up a particular application.

In my case, I want to put a User No into local storage.


you wanna open up the code window (its the one button on the far left that looks like </>. then click the + you see in the top right of the screenshot.
then click

this is what it looks like.... without my code in it lol.

if you click the Advanced tab, you see this
at the bottom the screen shot is what you're interested in Run this query on page load?. just put a checkmark in the box next to it.

and here's code to get you started with local storage

1 Like

OK, I have written code like what you have in the lower block.

But I am not sure where to put the code. Normally I would put it under a button. But in this case, I would like it to run automatically when the screen is opened.


the 1st two pictures show how to get there, you'll be looking for the menu bar on the left side of the screen near the top for where the 1st picture is referring to.....

maybe these will help? i made arrows and numbered steps.
Screenshot 2024-02-09 215807
Screenshot 2024-02-09 220028
Screenshot 2024-02-09 220228

Screenshot 2024-02-09 220720
Screenshot 2024-02-09 220841

don't forget to save the query. now the code u typed on the General tab will run when the page loads

1 Like


Yes, it works.
Your graphics really helped.
Thank you so much.
I will mark as the Solution.


its no problem at all. idk if you meamt to or not. but u actually marked your own reply as the solution. it's not a big deal to me, but for people in the future it might make it more difficult for them to find the solution you used.

I have tried to mark "solution" on your post and I cannot find a place to do that.


1 Like