cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Learnfromyou
Level 8

Having two events on a button. Only one event work

I have two events on a button... and I have the following code on screen2 for a button

   Set(var1,true); 
   Navigate(Screen1, None)

 

//Set(var1,true)  is to display something at the screen1 

 

So when i click that button with those events, it will not display anything.  But the navigate function works.  Thanks for reading.

8 REPLIES 8
santiago-obando
Level: Powered On

Re: Having two events on a button. Only one event work

Hi,

 

Could you check your condition on Screen1? (Maybe you could share a ScreenShot).

I did the exercise, it worked well:

 

Screen1.PNGScreen2.PNG

Learnfromyou
Level 8

Re: Having two events on a button. Only one event work

Here is a screenshot.  I want to press the button "I agree", it will navigate back to Screen1 and it change that var1 to true. 

 

That var1 is to make an invisible field - visible in Screen 1.  Thanks again.

Anonymous
Not applicable

Re: Having two events on a button. Only one event work

Hi @Learnfromyou,

 

the Navigation() function will be triggered first if it's in front of the Set() function,

you should place the Navigation() function after the Set() function like

Set(var1,true);Navigate(Screen1, None)

than it should work.

 

Best regards

Vasii 🙂

santiago-obando
Level: Powered On

Re: Having two events on a button. Only one event work

Hi, I can see that you placed the Navigate Function before the Set Function. I have had troubles doing that as well.
For me, the thing that worked was to put ALWAYS the Navigate Function at the end of all the Functions that I use for a Button (comparing with ASP.NET, It's like a Redirect at the end of my code).

Please let me know if I helped you.

Regards.
Learnfromyou
Level 8

Re: Having two events on a button. Only one event work

yeah, i tried to reverse that. it is still not working . I dont get any error messages, and the display just blinks for half a second on screen1. 

 

I am thinking that it might need a little timer between the two events? But that doesnt explain why it blinks.

Anonymous
Not applicable

Re: Having two events on a button. Only one event work

ya please show us a screenshot again with the reversed code 🙂

 

i've made a gif, hope this can help you a little bit 🙂

https://gyazo.com/156e04ceaad3a63f1aa3a7e4b0f11123


and i am from Europe so we use ; instead of a , and ;; instead of ; in powerapps

so pls use the code i posted before like 

Set(var1,true);Navigate(Screen1, None)

🙂

 

Best regards

Vasii

Learnfromyou
Level 8

Re: Having two events on a button. Only one event work

I got it to work now... i removed that 2nd page and blended into 1st page. What i meant is I created a rectangle that covers the entire page because it is used as a pop-up. Then the syntax work!  Hope I am making sense... 

santiago-obando
Level: Powered On

Re: Having two events on a button. Only one event work

It is great that you could make it work, kudos (Y).

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,837)