cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Stexsta18
Level: Powered On

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

Stexsta18
Level: Powered On

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

Stexsta18
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,852)