web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Having two events on a...
Power Apps
Unanswered

Having two events on a button. Only one event work

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

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.

Categories:
I have the same question (0)
  • santiago-obando Profile Picture
    11 on at

    Hi,

     

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

    I did the exercise, it worked well:

     

    Screen1.PNGScreen2.PNG

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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.

    cCapture.JPG
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    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 Profile Picture
    11 on at
    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.
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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 Profile Picture
    11 on at
    It is great that you could make it work, kudos (Y).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard