cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lauren_
Advocate IV
Advocate IV

Multiple IF statement

Hey folks, I'm having a blank on the following If statement. How can I put multiple 'true' statements into a single function? 

 

E.g. (this doesn't work but an idea of what I'm trying to do!)

 

If(Retain_1.Selected.Value="3 months",DataCardValue72.SelectedDate+90
Or If(Retain_1.Selected.Value="6 months",DataCardValue72.SelectedDate+180
Or If(Retain_1.Selected.Value="12 months",DataCardValue72.SelectedDate+365
Or If(Retain_1.Selected.Value="18 months",DataCardValue72.SelectedDate+3547,""))))

1 ACCEPTED SOLUTION

Accepted Solutions
zmansuri
Super User
Super User

Switch((Retain_1.Selected.Value,"3 months",DataCardValue72.SelectedDate+90,"6 months",DataCardValue72.SelectedDate+180,"12 months",DataCardValue72.SelectedDate+365,"18 months",DataCardValue72.SelectedDate+3547,Blank())

View solution in original post

6 REPLIES 6
zmansuri
Super User
Super User

Switch((Retain_1.Selected.Value,"3 months",DataCardValue72.SelectedDate+90,"6 months",DataCardValue72.SelectedDate+180,"12 months",DataCardValue72.SelectedDate+365,"18 months",DataCardValue72.SelectedDate+3547,Blank())

Perfect, thank you so much!!

Glad it worked

Hi Zmansuri, one more switching question for you please!

 

If I have a Radio and I want to set up a switch statement for the two radio options, based on whether or not two fields are filled in (it's one or the other), how do I get this to work?

 

Switch(Radio1.Selected.Value,!IsBlank(Gallery2.Selected.DisposalDate),"Disposed",!IsBlank(Gallery2.Selected.MTSMoveDate),"Move to MTS",""))

^this is what I'm trying but its not coming out right.

Haven't work with radio button yet. But your code seems to be missing first value:

 

Switch(Radio1.Selected.Value,"Value",!IsBlank(Gallery2.Selected.DisposalDate),"Disposed",!IsBlank(Gallery2.Selected.MTSMoveDate),"Move to MTS",""))

Hmm that's not quite right - thank you though Zmansuri, I'll keep at it trying to get my head around it! 🙂 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,303)