cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ammonroberts
Regular Visitor

Why can't we update properties to static values?

Hey y'all, I'm not really sure where to find the answer on my own, but I hope you folks might have some thoughts.

 

Why must we use Set() and UpdateContext() dynamically only? I really wish it were possible to use the following snippets:

UpdateContext({combobox_1.SelectedItems: ["something or other", "another thing"]});

or

Set(textbox_1.Text: "stuff");

 

Was it just a design decision, or to promote using dynamic properties?

 

I know it's been brought up 1000% times that something like this would be awesome, I'm mainly just hoping to understand why it's not possible currently.

 

Thanks y'all!

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @ammonroberts ,

When you come to Power Apps, think more of Excel than VBA (if you are familiar with the difference). All components of Power Apps have the potential to have dynamic properties and you simply set the property of whatever the element is "pointing at" (whether it be a Variable or a property of another component) and it changes if that item changes. This also "cascades" much like Excel calculating related cells.

I had to "unlearn" a lot of concepts with the main one being what you are referring to. Set and UpdateContext will (as you know) simply set Variables at which you can "point" whatever you want.

 

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.

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @ammonroberts ,

When you come to Power Apps, think more of Excel than VBA (if you are familiar with the difference). All components of Power Apps have the potential to have dynamic properties and you simply set the property of whatever the element is "pointing at" (whether it be a Variable or a property of another component) and it changes if that item changes. This also "cascades" much like Excel calculating related cells.

I had to "unlearn" a lot of concepts with the main one being what you are referring to. Set and UpdateContext will (as you know) simply set Variables at which you can "point" whatever you want.

 

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.

RandyHayes
Super User
Super User

@ammonroberts 

Because PowerApps is not a development platform.

It is built around Excel.  In Excel you do not set Cell B4 from another cell with something like : B4 = 2 + 2

Instead you put a formula in the Cell such as =2 + 2

 

So...that is one primary reason.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
ammonroberts
Regular Visitor

Wow, you guys! Thanks so much @WarrenBelz and @RandyHayes! I really was coming at this from a development attitude, and didn't even think that that might not be the best way to think about it... Thinking about it more from that point of view makes a huge difference, especially around the use of formulas for values. 

 

I will say that if Microsoft did end up adding a way to do this, I super wouldn't complain! 🙂

 

Thanks again, y'all! You rock!

RandyHayes
Super User
Super User

@ammonroberts 

Yes, you've got to get the "programmer" inside to go away.  When I started PowerApps years ago, it took me about 2 weeks of cursing and frustration to get past that point.  Once you look at it all as JSON data underneath and Excel like formulas on top, it all comes so clear and simple.  My rule to transition was, if I found myself writing a lot of formulas (or long ones) and especially putting them in actions (OnSelect, OnChange, etc. etc.)  then I was still letting my inner-programmer come out.  

 

Keep at it!! 🙂

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,531)