I'm building out a simple login page, I have email/password fields and a sign in button. The sign in button has two events attached to it: A simple query that looks for a username and password entered.
If the user is found then an array is returned with the data. (so long as the password matches then I want the Go to Page event to fire off)
If not then an empty array is returned. (User is not found, so I don't want the Go to Page event to fire)
Is there a way to execute an events conditionally?
Not sure I am following correctly, but there is a number of ways from preventing an event or query from executing.
-
via the Event Handler > Only run when - You can set a condition in the Advanced section of an event handler to when the event will run (i.e., the event will only execute if that condition returns true). Below is an example from an app I am currently building.
-
via Query > Advanced > Disable Query - This is an option in the query / code block itself where you can also set a condition where if it's True then the query won't run. Note this condition kinda works in the reverse of the first one (i.e., if it's True then the query is disabled).
-
via Disabled field in the inspector - Most components will have a Disabled field in the Inspector > Interaction section where you can also set a condition where if it's True the user will not be able to interact with the component.
Not sure what you specifically need, but hope this helps you open up your options.
1 Like
Thanks for this, it really helped! It took some fiddling but the first option worked!
Thanks no much!
1 Like