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

IF statement with multiple conditions

Hi there

I have an Event booking form where the number of delegates allowed per room depends on the layout of the venue, e.g. if the event is in the Auditorium and people want round or square tables, the maximum number of people allowed in the venue is 60 people;  however if they want to sit "cinema style" in the Auditorium, the maximum number of people allowed is 80 people.  I have entered the following IF statement on my "Capacity" label, but the formula does not seem to work.  

If(
VenueDD.SelectedText.Value in "Executive Dining(downstairs)" && LayoutDD.SelectedText.Value in "Round Tables";
"10";
VenueDD.SelectedText.Value in "Executive Dining(downstairs)" && LayoutDD.SelectedText.Value in "Square Tables";
"10";
VenueDD.SelectedText.Value in "Executive Dining(downstairs)" && LayoutDD.SelectedText.Value in "Cinema Style";
"15";
VenueDD.SelectedText.Value in "Auditorium" && LayoutDD.SelectedText.Value in "Round Tables";
"60";
VenueDD.SelectedText.Value in "Auditorium" && LayoutDD.SelectedText.Value in "Square Tables";
"60";
VenueDD.SelectedText.Value in "Auditorium" && LayoutDD.SelectedText.Value in "Cinema Style";
"80";
VenueDD.SelectedText.Value in "Room B307 & B308" && LayoutDD.SelectedText.Value in "Round Tables";
"16";
VenueDD.SelectedText.Value in "Room B307 & B308" && LayoutDD.SelectedText.Value in "Square Tables";
"16";
VenueDD.SelectedText.Value in "Room B307 & B308" && LayoutDD.SelectedText.Value in "Cinema Style";
"20";""
)

 

Your assistance would be appreciated.

Janine

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @janineb ,

Free typed, so watch commas & brackets etc, but try this

With(
   {
      wVenue:VenueDD.Selected.Value,
      wLayout:LayoutDD.Selected.Value
   };
   Switch(
      wVenue,
      "Executive Dining(downstairs)";
      If(
         wLayout = "Round Tables" || wLayoutDD = "Square Tables";
         10;
         wLayout = "Cinema Style";
         "15"
      );
      "Auditorium"; 
      If(
         wLayout= "Round Tables" || wLayout = "Square Tables";
         "60";
         wLayout = "Cinema Style";
         "80"
      );
      "Room B307 & B308";
      If(
         wLayout= "Round Tables" || wLayoutDD = "Square Tables";
         "16";
         wLayout = "Cinema Style";
         "20"
      );
      Blank()
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @janineb ,

Free typed, so watch commas & brackets etc, but try this

With(
   {
      wVenue:VenueDD.Selected.Value,
      wLayout:LayoutDD.Selected.Value
   };
   Switch(
      wVenue,
      "Executive Dining(downstairs)";
      If(
         wLayout = "Round Tables" || wLayoutDD = "Square Tables";
         10;
         wLayout = "Cinema Style";
         "15"
      );
      "Auditorium"; 
      If(
         wLayout= "Round Tables" || wLayout = "Square Tables";
         "60";
         wLayout = "Cinema Style";
         "80"
      );
      "Room B307 & B308";
      If(
         wLayout= "Round Tables" || wLayoutDD = "Square Tables";
         "16";
         wLayout = "Cinema Style";
         "20"
      );
      Blank()
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

You are an absolute lifesaver!  Thank you it worked perfectly!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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