cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimmyWork
Memorable Member
Memorable Member

Fly out menu visible even if variable is false

Hi

 

So I created a fly out menu according to Shane Youngs example: https://www.youtube.com/watch?v=D_Kb7AXSE0s

I only have one issue, when I start the app the Context variable is false but the fly out menu is still visible.

 

My Square icon (Menu sliding out)
X =

 

If(ShowMenu, -FlyOutMenu.Width + FlyOutMenu.Width * (Timer1.Value/Timer1.Duration), -FlyOutMenu.Width * (Timer1.Value/Timer1.Duration))

 

 

My timer

Start = StartMenuTimer

 

My button for expanding the menu.

OnSelect =

 

UpdateContext({StartMenuTimer:false}); UpdateContext({ShowMenu:!ShowMenu, StartMenuTimer:true})

 

 

My issue is when I Start the app, then the variable ShowMenu = false but the Menu (icon square) is still showing, once I click the button once then it is set to true and the menu slides out and next click the menu it slides in. But the first view when the app starts is that it's out like the ShowMenu = true but it equals false.

 

Im going crazy over this 😥

 

1 ACCEPTED SOLUTION

Accepted Solutions
JimmyWork
Memorable Member
Memorable Member

Solved it

 

MenuBlock

X = If(!varMenu2,1366,1366-200*(Timer3.Value/Timer3.Duration))
Width = If(!varMenu2,100,100+200*(Timer3.Value&Timer3.Duration))

Timer

Start = varTimer
OnTimerEnd = If(!varMenu2,Reset(Timer3),false)

Button

OnSelect = UpdateContext({varTimer:false});UpdateContext({varMenu2:!varMenu2, varTimer:true})

 

This produces a screen that at first shows no menu.

When button is click the menu slides out from the right side, when button is clicked again it closes the menu.

View solution in original post

7 REPLIES 7
WarrenBelz
Super User
Super User

Hi @JimmyWork ,

At screen OnVisible, put this

UpdateContext({ShowMenu:false})

 

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

 

@WarrenBelz Thank you but I have already tried this and it does not work, it still shows

JimmyWork
Memorable Member
Memorable Member

In another solution that just uses visible true or false, no sliding menu all I had to do was.

OnSelect = UpdateContext({FiltersOn:!FiltersOn});

Visible = If(FiltersOn, true, true, false)

 

The it would not be visible and button works as it should, but with this sliding out menu nothing seems to be working. The variable is false by default so I don't know why it's even showing

JimmyWork
Memorable Member
Memorable Member

test.gifSeems like I got something working like I Want to but I'm pretty sure it's not the correct way of doing this.

 

My Square icon (Menu sliding out)
X =

 

If(!ShowMenu, 670+FlyOutMenu.Width* (Timer1.Value/Timer1.Duration), 670+FlyOutMenu.Width- FlyOutMenu.Width * (Timer1.Value/Timer1.Duration))

 

Visible

 

If(ShowMenu = true, true, false)

 

 

My timer

Start = StartMenuTimer
OnTimerEnd

 

If(!ShowMenu,Reset(Timer1), false)

 

 

My button for expanding the menu.

OnSelect =

 

UpdateContext({StartMenuTimer:false}); UpdateContext({ShowMenu:!ShowMenu, StartMenuTimer:true})

 


 

@JimmyWork ,

As you can understand, I can only be guided by what you posted and if you set the Visible to false and this is the only criteria, it cannot possibly show. It seems the timer also has something to do with it.

@WarrenBelz Not sure what you mean, setting it to false actually made it work. Not showing when started. before i had the issue with when the variable was false the menu was still showing at start and even if you set the variable OnVisble it was still showing.

 

What I posted achieves what I want, but, it's not done correctly like you stated with the visible part.

Defiantly something with the timer but I don't know how to solve this, been stuck on it for to long 😞

JimmyWork
Memorable Member
Memorable Member

Solved it

 

MenuBlock

X = If(!varMenu2,1366,1366-200*(Timer3.Value/Timer3.Duration))
Width = If(!varMenu2,100,100+200*(Timer3.Value&Timer3.Duration))

Timer

Start = varTimer
OnTimerEnd = If(!varMenu2,Reset(Timer3),false)

Button

OnSelect = UpdateContext({varTimer:false});UpdateContext({varMenu2:!varMenu2, varTimer:true})

 

This produces a screen that at first shows no menu.

When button is click the menu slides out from the right side, when button is clicked again it closes the menu.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,248)