cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User III
Super User III

Question about the Set function

Hi, Could someone please explain in practical terms, the meaning of these sentences from the documentation?

 

https://powerapps.microsoft.com/en-us/tutorials/function-set/

 

"PowerApps are based on formulas that automatically recalculate as the user interacts with an app. Global variables don't offer this benefit and can make your app harder to create and understand."

 

------------------------------------------------------------------------------------------------

My interpretation of what this says is this. Suppose I have a label with the text property set to this:

 

Label1.Text = MyGlobalVariableValue

 

I then add a button and set the OnSelect action to this:

 

Set(MyGlobalVariableValue, "Hello World")

 

According to what I think the documentation says, this should not work because global variables don't participate in dynamic formula recalculations. However, this isn't the case because I've tested this scenario and it works. When I click the button, the label shows the text "Hello World".

 

This documentation conveys some warning about using global variables and I'd like to understand what that is. Could someone explain the benefit that global variables don't offer, and how they can make my app harder to create and understand?

 

Many thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Question about the Set function

Hi timl,

 

There is another documentation about Global variable, please check the part “Create a global variable” in this documentation for more details:
https://powerapps.microsoft.com/en-us/tutorials/working-with-variables/

 

But about documentation on the benefit that global variable doesn’t offer and how it makes app harder to create and understand, so far I haven’t seen a related one.

 

If you have any questions when using Set() function, please feel free post your issues here. About the disadvantages of Global variable, I will keep an eye on it and try to find some related information.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: Question about the Set function

Hi timl,

 

There is another documentation about Global variable, please check the part “Create a global variable” in this documentation for more details:
https://powerapps.microsoft.com/en-us/tutorials/working-with-variables/

 

But about documentation on the benefit that global variable doesn’t offer and how it makes app harder to create and understand, so far I haven’t seen a related one.

 

If you have any questions when using Set() function, please feel free post your issues here. About the disadvantages of Global variable, I will keep an eye on it and try to find some related information.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,197)