cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Advice on using IF Statement

I have been struggeling with this code.. and can not seem to get it to work any help would be awesome!

If(DataCardValue6.Value >10000,DataCardValue6 *0.25,DataCardValue6 *0.45)

DataCardValue6 is a text input control and its set to Number, and is set to number within SharePoint too. 

 

but when I apply the above code i get the following message 
PowerApps Issue.JPG

 

The above works if its a slider but  I want it to be a free text to type into. 

Thanks again
Jonny

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User
Super User

Re: Advice on using IF Statement

@Stexsta18 

Text inputs always return a text data type so that's why you are having an issue.  A text data type cannot be greater or less than some number data type.  The solution is to convert to a number data type so the comparsion can take place.

 

This code assumes DataCardValue6 is a text input field.

 

If(Value(DataCardValue6.Text) >10000,DataCardValue6 *0.25,DataCardValue6 *0.45)

 

---
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
Frequent Visitor

Re: Advice on using IF Statement

That is fantastic thank you so much. been banging my head against the wall with this issue.

Really appreciate it.

Thanks again
Jonny

View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: Advice on using IF Statement

@Stexsta18 

Text inputs always return a text data type so that's why you are having an issue.  A text data type cannot be greater or less than some number data type.  The solution is to convert to a number data type so the comparsion can take place.

 

This code assumes DataCardValue6 is a text input field.

 

If(Value(DataCardValue6.Text) >10000,DataCardValue6 *0.25,DataCardValue6 *0.45)

 

---
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
Frequent Visitor

Re: Advice on using IF Statement

That is fantastic thank you so much. been banging my head against the wall with this issue.

Really appreciate it.

Thanks again
Jonny

View solution in original post

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 (6,685)