Gotcha's from the front 1. Label.Text set to...
Text(Value(Label_2_RqdCalc.Text) * Value(First(Filter(Dassumptions,Assumptions="Ass1")).Figure ),"[$-en-GB]#")
...and it displays blank, nothing at all. Take the "[$-en-GB]#" out and it works fine, displaying 0.
Problem was caused by formatting Label_2_RqdCalc.Text as text(......,"#kg"). Sticking kg on the end means Powerapps can no longer convert it back to a number (even using value). so it can't use it in the above calculation. It CAN convert some formats. Currency ones are OK.
As always, obvious when you know!
If you have additional text in a label beside digits, you can always use this approach to get just the numbers:
Value(Match(yourLabel.Text, "\d*").FullMatch)
This will return just the digits in the text and strip off all the rest (like kg).
Also, consider not using First(Filter it is a performance hog as PowerApps needs to filter ALL records in your datasource first and then it just returns the first. The function LookUp is preferable as it stops at the first record it finds.
LookUp(Dassumptions, Assumptions="Ass1", Figure)
I hope this is helpful for you.
Nice one Randy. Thanks for both tips. And yes, very useful.
User | Count |
---|---|
157 | |
92 | |
80 | |
74 | |
58 |
User | Count |
---|---|
196 | |
166 | |
99 | |
95 | |
79 |