cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Phineas
Post Prodigy
Post Prodigy

Mulitple Condition Statement Architecture

I have the following statement in a field.

 

I am using the statement to provide metadata to concatenate with another field to make a UniqueID. I have 20 different Titles to write into the condition.

 

Am I required to write out each portion of the condition for all 20, or is there a way to shorten the statement while including all 20 conditions.

 

     If(GalleryDropdown.SelectedTest.ClassTitles="Bus Driver","BD",
     If(GalleryDropdown.SelectedText.ClassTitles-"Cab Driver","CD",... 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Phineas 

Please consider changing your Formula to the following:

Switch(GalleryDropdown.Selected.ClassTitles,
   "Bus Driver", "BD",
   "Cab Driver", "CD",
    ... 
)

If you are just trying to get an abbreviation of the titles (as it looks from the sample you provided) then you can do that even easier than typing a long switch statement.

 

Also your original formula had .SelectedText in it.  Avoid using that property as it has been deprecated. 

 

I hope this is helpful for you.

_____________________________________________________________________________________
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

1 REPLY 1
RandyHayes
Super User
Super User

@Phineas 

Please consider changing your Formula to the following:

Switch(GalleryDropdown.Selected.ClassTitles,
   "Bus Driver", "BD",
   "Cab Driver", "CD",
    ... 
)

If you are just trying to get an abbreviation of the titles (as it looks from the sample you provided) then you can do that even easier than typing a long switch statement.

 

Also your original formula had .SelectedText in it.  Avoid using that property as it has been deprecated. 

 

I hope this is helpful for you.

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

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (4,928)