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 / Making navigation appe...
Power Apps
Answered

Making navigation appear/disappear based on screen size, content, and on demand

(0) ShareShare
ReportReport
Posted on by 26

Hi,

 

I'm currently using the responsive "sidebar" screen layout in my canvas app. On the left sidebar is a gallery that contains data that is stored in SharePoint.  The SharePoint list is set up in such a way that users only see their own entries.  So, when they go into the app for the first time, the gallery is empty.  This is one scenario where I'd like the app to load with the left sidebar hidden.  The other two conditions are as follows:

- Hide the left side bar when the user presses a button (so they can maximize screen real estate if they are working on a laptop)

- Hide the left side bar when the screen size is less than 3 (but allow the user to click a button to bring the side bar back when needed)

 

Any ideas as to how to accomplish this?  Thank you in advance for your help!

Categories:
I have the same question (0)
  • SharePointDev12 Profile Picture
    84 on at

    I suggest you create a custom component it meets your requirement well. Go through the below video from Reza Dorrani it helps you a lot.

     

    SharePointDev12_0-1630128259626.png

     



    https://youtu.be/dP74npyyvGc

  • RosalindK Profile Picture
    26 on at

    Thank you for the reference to that video by Reza Dorrani.  He's always a source of excellent tutorials.  However, that particular functionality demonstrated in the video only supports one of my requirements (on demand showing/hiding of a gallery).  I'm looking to combine this functionality with two others.  I would like the left sidebar to disappear if there is no content (that is, when someone is opening the app for the very first time).  I would also like it to disappear when the screen size is less than 4. However, with both of those options, I would like the user to be able to override this behaviour with a button.   I have that part working okay but when I try to implement the other two functionalities, it just doesn't work.   Below is the code used in the main screen OnVisible event and in the sidebar container visible property.   The button used to control the sidebar manually has the expected OnSelect content:  UpdateContext({ctxSideBar: !ctxSideBar})Main_OnVisible.pngSidebar_Visible.png

     

    I've tried many variations above the above but to no avail.  Any suggestions would be welcome!  Thanks!

  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @RosalindK 

     

    1. Set Onscreen visible property to

     

    If(ScreenName.Size>3,UpdateContext({ctxSideBar:true}),UpdateContext({ctxSideBar:false}))

     

    2. Icon Onselect Property to

     

    UpdateContext({ctxSideBar:!ctxSideBar})

     

    3. Set SideBarContainer Visible property to

     

    ctxSideBar && CountRows(GalleryName.AllItems) > 1

     

     

  • RosalindK Profile Picture
    26 on at

    That did it! 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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 431

#2
WarrenBelz Profile Picture

WarrenBelz 360 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 280 Super User 2026 Season 1

Last 30 days Overall leaderboard