cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

"Indent" where "Control" is expected

I'm trying to "Set(ShowMenu, true)",  on the "OnStart" property of the App (global). "ShowMenu" is already being declared on a local variable using "UpdateContext({ShowMenu: false})" on another screen.

I'm getting this: "Unexpected Characters. The formula contains Indent where Control is expected"

I'm assuming this is because of the scope conflict of these two variables.

I'm doing this because on the start of the App I have a lateral menu that should be hidden but is not.

 

Many thanks

1 ACCEPTED SOLUTION

Accepted Solutions
JR-BejeweledOne
Super User
Super User

From what I can see you have declared ShowMenu as a global variable on Appstart but as a local variable on your other screen.   The UpdateContext function declares the variable as local, which means it can only be used on that screen.

 

Here is the documentation

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-updatecontext



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

View solution in original post

2 REPLIES 2
JR-BejeweledOne
Super User
Super User

From what I can see you have declared ShowMenu as a global variable on Appstart but as a local variable on your other screen.   The UpdateContext function declares the variable as local, which means it can only be used on that screen.

 

Here is the documentation

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-updatecontext



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
Anonymous
Not applicable

That makes sense. It would be pointless to build a variable to be local, but still be accessible globally.

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (5,350)