I have an issue with data comparison
Visibility property for (errormessage)
If(Value(DataCardValue9.Text) > Value(compassionateleavebalance.Text),true, false )
in app testing it works well, but when published it does not work well, the error message displays when any digit is typed into the (DatacardValue9.Text) field even if it is actually less than the DataCardValue9.
Please help guys
Solved! Go to Solution.
That means you are comparing a Number to something else (e.g. Text) in your If statement. Try putting SickLeaveBalance inside a Value() function
If you want to see what the collection looks like during troubleshooting just put it in a Data Table temporarily. Similarly you can put the Set variables in Labels temporarily. Just to see their values.
the values are correct in the data table the 4ilters are correct too.
but when i call the SickLeaveBalance into a label i get and error saying the datatype is Table, expected text value
I made a mistake in my code earlier on and now I've been able to test. Here's what you should put in the OnStart property. Remove the FIRST function from COLLECT and then put it in each of the SET functions as shown below.
Collect(LeaveBalances,Filter('Leave Balance List','Staff Name'.Email = CurrentUserEmail)); Set(AnnualLeaveBalance,First(LeaveBalances).'Annual Leave Balance'); Set(SickLeaveBalance,First(LeaveBalances).'Sick Leave Balance'); Set(CompassionateLeaveBalance,First(LeaveBalances).'Compassionate Leave Balance');
Now all of your SET varaibles will be data type text.
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."
HI @abieba ,
Could you please share a bit more about your scenario?
Do you mean that the data value comparison does not work when running the published app?
Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned.
Please consider modify your formula as below (set the Visible property of the error message Label to following):
Value(DataCardValue9.Text) - Value(compassionateleavebalance.Text) > 0,
If( Value(Trim(DataCardValue9.Text)) - Value(Trim(compassionateleavebalance.Text)) > 0, true, false )
Please also consider take a try with above solution, check if the issue is solved.
If the issue still exists, please consider re-create a new app, then try above formula again, check if the issue is solved.
Check out new user group experience and if you are a leader please create your group
Next call is happening on April 21st at 8a PST.
May the fourth be with you, join us online!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.