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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to change Screens ...
Power Apps
Answered

How to change Screens with OnSelect using components?

(0) ShareShare
ReportReport
Posted on by 80
I got this component field:  how do I upon on click change the screens 
I am using TargetScreen: App.ActiveScreen, how should I change it to solve the error message?
I have the same question (0)
  • Suggested answer
    Daniel Bocklandt Profile Picture
    5,117 Super User 2025 Season 2 on at
    Hey Philbert9879,
     
    Could I ask you what you are trying to achieve? 
    What you doing right now will just keep you to stay on the screen that you are on right now. App.ActiveScreen is the Screen that is visible at the moment
     
    so your If Statement will always result to being wrong since you have it on Home screen and this will always result in you staiyng on the home screen since every target screen is App.ActiveScreen. 
     
    Either you use The actual Screen titles to get your table to work or you can use a Switch statement something like this: 
    If(ThisItem.Title<>Actual Screen name or title, 
      Navigate(
        Switch(
          ThisItem.Title, 
          "My Leave Balance",
          'title of Leave balance screen',
          "Company Holiday",
          'Expected Screen')
    )
    )
    If this Solved your problem please accept it as solution so others can find it as well. 
    If it helepd in any other way consider giving it a like so wa can keep supporting eachother. 
     
  • Verified answer
    Nandit Profile Picture
    1,568 Moderator on at
     
    Collect all your navigation items in a variable using OnStart:
    Set(
        colSidebarMenu,
        Table(
            {
                Title: "My Leave Request",
                Screen: LeaveBalance
            },
            {
                Title: "My Leave Balance",
                Screen: LeaveRequest
            }
        )
    )
    Add a Custom Input property to your Component, "ItemsTable", and add the following code it:
    Table(
        {
            Title: "Item 1",
            Screen: App.ActiveScreen
        },
        {
            Title: "Item 2",
            Screen: App.ActiveScreen
        }
    )
    In your Component, update the Items property of your Gallery to 
    ComponentName.ItemsTable
    OnSelect Property of your Gallery:
    Navigate(ThisItem.Screen)
    Add your Component to the screens and add your Variable to the ItemsTable input property:
    colSidebarMenu
    And that's it!
     
    Here's step-by-step guidance on this topic by Matthew Devaney: https://www.matthewdevaney.com/power-apps-navigation-menu-component/
     
    Hope this helps. 
     
    Kind regards. 
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 563 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 303 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 243

Last 30 days Overall leaderboard