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 / How to create a multip...
Power Apps
Answered

How to create a multiple if and filter statement in one gallery?

(0) ShareShare
ReportReport
Posted on by 55

Hi Everyone,

Good day.

Is it possible if I create a code where I can have multiple filters and if statements?

Here's the scenario.

I have gallery where I can filter the list of save Items. I also have drop down where I can show the gallery of 4 tables. I also have input text for search.

Here's my code on the gallery
Items = If(Dropdown.SelectedText.Value = "Table1", Filter(Table1,Save),(Search(Table,TextInput.Text,"Column1","Column2","Column3")
But there's no save items shown.

I also want to add 
Filter(Table1, User.Email = varUserEmail,Save,true) so that the items saved is based on the current user.

Thank you.

Categories:
I have the same question (0)
  • Verified answer
    PrachiM Profile Picture
    23 on at

    Here's an updated version of the code that you can use to filter the gallery based on the selected table, the text entered in the input text, and the current user's email:

     

    Items = If(Dropdown.SelectedText.Value = "Table1", 
     Filter(Table1, User.Email = varUserEmail && Save = true, Search(Table1,TextInput.Text,"Column1","Column2","Column3")),
     If(Dropdown.SelectedText.Value = "Table2", 
     Filter(Table2, User.Email = varUserEmail && Save = true, Search(Table2,TextInput.Text,"Column1","Column2","Column3")),
     If(Dropdown.SelectedText.Value = "Table3", 
     Filter(Table3, User.Email = varUserEmail && Save = true, Search(Table3,TextInput.Text,"Column1","Column2","Column3")),
     If(Dropdown.SelectedText.Value = "Table4", 
     Filter(Table4, User.Email = varUserEmail && Save = true, Search(Table4,TextInput.Text,"Column1","Column2","Column3")), 
     {}
     )
     )
     )
     )

     

    In this code, the Items property of the gallery is set based on the selected table in the dropdown. The Filter function filters the selected table based on the current user's email (varUserEmail) and the Save column set to true. The Search function is then used to search the filtered list based on the text entered in the input text. The If function is used to handle the different possible values of the selected table in the dropdown.

  • Beelieve Profile Picture
    55 on at

    Hi @PrachiM thank you very much it's working now I just revised a little on the code structure.

    If(Dropdown.SelectedText.Value = "Table1", 
     Filter(Table1, User.Email = varUserEmail,Save,true), (Search(Table1,TextInput.Text,"Column1","Column2","Column3")))

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

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard