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 / One Button Component t...
Power Apps
Answered

One Button Component that behaves differently on different screens

(0) ShareShare
ReportReport
Posted on by 12

Hello,

how can I create a Button Component that behaves different on each screen. For example when I click on it on Screen1, it should navigate to screen 2 and when I click on it on Screen3, it should navigate to screen 4. I tried an If Statement with App.Active.Screen but it did not work. 

Thanks, Mazlum

Categories:
  • mmollet Profile Picture
    3,187 on at

    Try the following:

     

    Switch(
     App.ActiveScreen.Name,
     "Screen1",
     Navigate(Screen2),
     "Screen2",
     Navigate(Screen3),
     "Screen3",
     Navigate(Screen1)
    )

     

    EDIT: I should have been more clear like but like @LaurensM said this solution is just using a stand alone button control and just copy, paste, rename to the screens. Seems more simple to not use a component in this case.

     

     

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Mazlum,

     

    To double check: are you referring to a Canvas Component? If you are only using 1 button within that component, in my opinion you are better of just using different button controls in those screens. The main advantage of Canvas Components is building reusable components from multiple controls that are shared accross screens - think of a headers, footers, navigation bars, pop-ups... Instead of having to create all of this logic from scratch or copy-pasting, you can simply levarage Canvas Components (create once and reuse).

     

    That being said, if you want to make your screen navigation dynamic: you will have to create a Custom Input property of type Screen (Click on the Component Tab, Click on your component and on the right side you should see 'Custom Properties'). The actual navigation logic will be built in the button in the component itself (OnSelect of the button: Navigate(ComponentName.CustomInputName ) ). When using the component in your app screen, you will now see an additional property with the name if your custom input property, simply add the required screen name there.

     

    Links that will be of help are:

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard