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 / stay on current tab on...
Power Apps
Unanswered

stay on current tab on refresh

(0) ShareShare
ReportReport
Posted on by 302

I have a gallery with buttons as tabs. Each tab is a new screen on the page. How do i make it so when the page refreshes it stays on the current page youre on instead of going back to tab one?

Categories:
  • Vaish123 Profile Picture
    142 on at

    Hi, 
    create a global variable to store the current tab 

    1. OnVisible of each screen
    UpdateContext({selectedTabIndex: 1}); // Set it to the appropriate index of each screen

     

     

    2. OnStart of the app
    If(
    Not(IsBlank(selectedTabIndex)),
    Switch(
    selectedTabIndex,
    1, Navigate(Screen1, None),
    2, Navigate(Screen2, None),
    // Add more cases for each screen/tab
    )
    )

    Just in case my answer helped you solve your problem, please mark/accept this as a SOLUTION.  This helps community members if they experience a similar issue in the future.
  • el5 Profile Picture
    302 on at

    the onstart gave errors it said the isblank had invalid arguments and the switch doesnt recognize the variable.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard