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

Set default value based on dollar amount and category

I have an app where if a person choose one type of safety equipment there is a max amount that will be reimbursed up to that amount.

 

I am trying to write this but missing the syntax completely I think.

 

Switch(DataCardValue66.Text,
    "Safety Toe Boots" & Value(DataCardValue75.Text) <= 300.00,DataCardValue75.Text, "300.00",
    "Prescription Safety Eye Wear" & Value(DataCardValue75.Text)<= 250.00,DataCardValue75.Text, "250.00"
)

Basically if they purchase safety boots they will be reimbursed up to the value paid if less then 300 but if it is more then 300 they will only be reimbursed 300 the same for Safety Glasses.

 

Any help would be appreciated.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Dorinda 

I would not recommend having these things written into your formulas like this (what happens when 300 needs to become 350?)

But, your formula should be:

Switch(DataCardValue66.Text,
    "Safety Toe Boots", 
        If(Value(DataCardValue75.Text) <= 300.00, DataCardValue75.Text, "300.00"),
    "Prescription Safety Eye Wear", 
        If(Value(DataCardValue75.Text)<= 250.00, DataCardValue75.Text, "250.00")
)

 

I hope this is helpful for you.

(p.s...haven't had a chance to look over your other message - hopefully shortly!)

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

2 REPLIES 2
RandyHayes
Super User
Super User

@Dorinda 

I would not recommend having these things written into your formulas like this (what happens when 300 needs to become 350?)

But, your formula should be:

Switch(DataCardValue66.Text,
    "Safety Toe Boots", 
        If(Value(DataCardValue75.Text) <= 300.00, DataCardValue75.Text, "300.00"),
    "Prescription Safety Eye Wear", 
        If(Value(DataCardValue75.Text)<= 250.00, DataCardValue75.Text, "250.00")
)

 

I hope this is helpful for you.

(p.s...haven't had a chance to look over your other message - hopefully shortly!)

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Perfect that worked like a charm.!!!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,685)