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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

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

Top Kudoed Authors
Users online (4,003)