web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Combine If Statements
Power Apps
Unanswered

Combine If Statements

(0) ShareShare
ReportReport
Posted on by 5,331 Moderator

I have a Dropdown that I am using to filter a Gallery.

I am setting the content of the Dropdown based on the choice of a Radio control. When the user changes the Radio control the options in the Dropdown change. I've gotten to two to work independently, but I can't figure out how to combine the two. 

If(ReviewGalleryFilterByRadioControl.Selected.Value="Purchasing Agent", Distinct(SMCollection,Manager)

If(ReviewGalleryFilterByRadioControl.Selected.Value="Status",["Pending","Reviewed"], If(ReviewGalleryFilterByRadioControl.Selected.Value="Event Name",["Comic Book Conference","Movie Trailer Conference"])))

I also need a forth added:

 

     If(ReviewGalleryFilterByRadioControl.Selected.Value="Move/Television", Distinct(SMCollection,MovieTelevision)

Categories:
I have the same question (0)
  • EddieE Profile Picture
    4,641 Moderator on at

    @Phineas 

    The issue here is that you are trying to combine tables of 2 different schemas inside your DropDown. Distinct() returns a table with a column called 'Result' and using the [ ... ] approach returns a table with a column called 'Value', so we need to fix this. We can do this using RenameColumns().

     

    Try this code

    Switch(
     ReviewGalleryFilterByRadioControl.Selected.Value,
     
     "Purchasing Agent", RenameColumns( Distinct(SMCollection,Manager), "Result", "Value"),
     "Status",["Pending","Reviewed"], 
     "Event Name",["Comic Book Conference","Movie Trailer Conference"],
     "Move/Television", RenameColumns( Distinct(SMCollection,MovieTelevision), "Result", "Value")
    )

    I also took the liberty of using Switch over If() as your code is better suited to this approach.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 477

#2
WarrenBelz Profile Picture

WarrenBelz 341 Most Valuable Professional

#3
11manish Profile Picture

11manish 317

Last 30 days Overall leaderboard