Display alert if a user click on a content

Hello

I would like to know how to set up a logic as below:
If a user click for the first time on the content of the page then an alert will pop up but if it is not the first time then it should go to another page.

Thank you

one way but not so efficient (i cant think of any other) is to have a page var true/false
and an if like this IF(IS_EQUAL(pageVars.variable1, false), true, false)
image

at fist tap its false so it becomes true at the second its true so it goes to next page

if you want to reset it you can add set page var to false in page focused

It works but every time I change the page and go back to the one with this logic I have the alert or I would like to not have it if users come back to this page and already have clicked on the component

to do that,

you need to change it from a page var to an app var and also delete the set variable to false when page is focused

Hello

I tried this way but it is not working. Here is what I have setup so far

image

Alright, all this looks right, can you explain once again whats the problem?

So when I click on the component I can see the alert and it moves to the next page that’s ok but if I go back to the previous page and click again on the component I see the alert.
The component is on a Menu page and I would like to display an alert the first time people open this menu and click on component but if they come back to this page and click on the component I don’t want to have a message.
For example User is opening the page Menu click on the component it displays the alert and goes to another page. On this page he will select some option and when he goes back to the menu page and click again on the component I don’t want to have the alert again. Just the first time he clicks on a message.

I tried to summarize here

1 Like

These two are exactly as i told you above?

if yes, did you added the set app variable when page focused?
if yes just delete it and it should work as you said

Hello

Yes I have delete it but it does not work as I want

ok then, if you send some images it will be easier to debug.
we need to check
the app variable
the if function
and the set app variable
and make sure that you dont use that variable anywhere else.

Here are the screenshot
the app variable

the If function
image

the set app variable
image

on the page the logic are like that ( i have removed the set variable when page focused)

the problem is in this image, when you set the app variable

you need to se it to false not to true

1 Like

Perfect indeed it is working!
Thank you for your time and your help!!

1 Like