Hi All,
I am not sure I got this right, maybe for the App.Width this might not work but I thought that Variables in PowerApps when referenced with a value that changes will be updated as well.
I am trying to make a scaling formula that I need to use everywhere so I can just pass a variable instead of placing the formula everywhere.
It is something like this at App Start
Set(_scale, 16+(40-16)*((App.Width - App.MinScreenWidth) / (Last(FirstN(App.SizeBreakpoints, 3)).Value - App.MinScreenWidth)
Any ideas what I doing wrong? I tried disabling non blocking and delayed load. That did not change a thing.
Solved! Go to Solution.
Yes, this works perfectly and quite honestly, we use this approach 100 times over variables. Variables never change, the concept is that controls are global in PowerApps and will automatically change based on their formulas...so, why not use that concept!
Variables are ALWAYS snapshots in time. They do not update until you update them.
You can consider what I call a "dynamic variable". For this, place a label in your app - Let's call it lblScale and set the Text property to the following:
16+(40-16)*(
(App.Width - App.MinScreenWidth) /
(Last(FirstN(App.SizeBreakpoints, 3)).Value - App.MinScreenWidth)
)
Now, this label will change dynamically as any of the items it the formula change.
You can reference this anywhere in your app with Value(lblScale.Text)
I hope this is helpful for you.
Hi @RandyHayes ,
That is very clever "hack".
I will give it a try and accept, It seems the right thing to do, especially that my app has only one screen, so should work everywhere.
Yes, this works perfectly and quite honestly, we use this approach 100 times over variables. Variables never change, the concept is that controls are global in PowerApps and will automatically change based on their formulas...so, why not use that concept!
User | Count |
---|---|
198 | |
123 | |
85 | |
50 | |
42 |
User | Count |
---|---|
284 | |
159 | |
134 | |
73 | |
73 |