cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

Re: Number Value Comparison

@abieba 

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.

Highlighted
Helper III
Helper III

Re: Number Value Comparison

Hi @mdevaney 

 

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

Highlighted
Super User
Super User

Re: Number Value Comparison

@abieba 

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."

View solution in original post

Highlighted
Community Support
Community Support

Re: Number Value Comparison

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):

 

If(
Value(DataCardValue9.Text) - Value(compassionateleavebalance.Text) > 0,
true,
false
)

or

 

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.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,511)