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.
We're excited to announce our first cross-community 'Can You Solve These?' challenge!
Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.
We are excited for the next Super User season.
FIll out a quick form to claim your community user group member badge today!
Features releasing from October 2020 through March 2021