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 / Menu Component Slide O...
Power Apps
Unanswered

Menu Component Slide On/Off Screen

(0) ShareShare
ReportReport
Posted on by 72

I'm creating a component menu that will slide on and off the screen based on the following videos:

https://www.youtube.com/watch?v=3S0h2nODcxM&t=613s (menu component)
https://www.youtube.com/watch?v=D_Kb7AXSE0s&t=1158s (slide on/off screen)
(Thank you to both of you!)

 

I have 5 screens each with my menu component on it and each screen has a hamburger icon on it to move the menu component on and off the screen.

 

I'm having trouble with two things:
1. Getting the hamburger icon to toggle the menu on/off the screen.
2. Having the menu revert to off the screen again after a menu selection is made.

 

The menu component has a Boolean custom input property called ExpandMenu with a default of false/off.

 

comMenu_Home X = If(comMenu_Home.ExpandMenu, 0, -comMenu_Home.Width)

 

icoHamburger_Home OnSelect = comMenu_Home.ExpandMenu = !comMenu_Home.ExpandMenu

 

I thought the above would toggle the menu on/off screen, but it is doing nothing.

 

This is my first Power App, so I'm not sure if I'm trying to do this the right way and would appreciate any help.

 

Thanks,
J

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @BPNJMC1 

    Your OnSelect action needs to set a variable.

    Change it to : UpdateContext({comMenu_Home: !comMenu_Home})

     

    If your property of the component is just a boolean value, then set it to : comMenu_Home

     

    You cannot set properties of controls in PowerApps by directly setting like you would in a development platform.  PowerApps is modeled after Excel - everything is by reference.  So, just like in Excel, you would not put a formula in a cell that says : B3="Hi"  instead you would put "Hi" in the B3 cell.  Same in PowerApps, you would put a formula in the Property you want to change based on other factors.

     

    I hope this is helpful for you.

  • BPNJMC1 Profile Picture
    72 on at

    @RandyHayes 

    Thank you - I made the following changes and the hamburger icon is toggling the menu on and off the screen again:

    Hamburger Menu OnSelect = UpdateContext({ShowMenu: !ShowMenu})
    comMenu_Home = If(ShowMenu,0,-comMenu_Home.Width)

     

    I still have problem #2:

    After a menu choice is selected, the menu needs to move off the screen again to -comMenu.Width.  I can't seem to figure out how to reset the x for the menu component (comMenu) back to -comMenu.Width.  

     

    J

     

  • Verified answer
    BPNJMC1 Profile Picture
    72 on at

    I figured out the 2nd issue.   Here's a summary of the solution:

     

    1. Getting the hamburger icon to toggle the menu on/off the screen.

    hamburger icon OnSelect property = UpdateContext({ShowMenu: !ShowMenu})
    component comMenu_Home X property = If(ShowMenu,0,-comMenu_Home.Width)


    2. Having the menu revert to off the screen again after a menu selection is made.

    screen OnVisible property = UpdateContext({ShowMenu: false})

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard