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 / Navigate() going to Wr...
Power Apps
Answered

Navigate() going to Wrong Screen

(0) ShareShare
ReportReport
Posted on by 427

So, Riddle me this....

 

I have a Horizontal Gallery that contains a single button - I use this as a "Tab navigator".

The Gallery.Items is set to a custom Collection: "col_menu", which is defined in the App.OnStart as follows:

 

 

Set(col_menu,Table(
 {Title:"Tab 1", Screen: Screen_1},
 {Title:"Tab 2", Screen: Screen_2},
 {Title:"Tab 3", Screen: Screen_3},
 {Title:"Tab 4", Screen: Screen_4},
));

 

The button in the gallery then just has a simple OnSelect action:

 

Navigate(ThisItem.Screen)

 

Fairly simple, yes? And it's been working fine for over 2 years (I've used this technique all over the place and it's always been OK)

 

I just came to edit an app and add a new screen to the mix, so I added a new entry to the col_menu collection:

 

{Title:"Tab 5",Screen:Screen_5}

 

 

Unfortunately, PowerApps just doesn't want to play ball, and keeps navigating to the WRONG screen for this new entry - and this happens in BOTH the Studio, and when playing the published app in a browser (Chrome).

 

Click on "Tab 1" - Navigates to Screen_1 - OK

Click on "Tab 2" - Navigates to Screen_2 - OK

Click on "Tab 3" - Navigates to Screen_3 - OK

Click on "Tab 4" - Navigates to Screen_4 - OK

Click on "Tab 5" - Navigates to Screen_1. -  even though the collection clearly states "Screen_5"

 

I am so confused - how on earth can this work for 4 elements of the gallery, but not the 5th?

 

Has anyone else seen any funny behaviour of the Navigate() function?

 

James.

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,953 Most Valuable Professional on at

    Hi @james_hathaway ,

    Strangely, I have never been able to get that to work properly consistently, so I just hard-code it OnSelect

    Switch(
     Self.Selected.Title,
     "Tab 1",
     Navigate(Screen_1),
     "Tab 2",
     Navigate(Screen_2),
     "Tab 3",
     Navigate(Screen_3),
     "Tab 4",
     Navigate(Screen_4),
     "Tab 5",
     Navigate(Screen_5)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • james_hathaway Profile Picture
    427 on at

    Hi @WarrenBelz ,

     

    Thanks for that workaround - works like a charm!
    Still, it's funny how the Navigate(ThisItem.Screen) will work for some items of the gallery, but not others...

    ... very strange!

     

    James.

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