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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to filter Gallery ...
Power Apps
Unanswered

How to filter Gallery based on multiple condition

(0) ShareShare
ReportReport
Posted on by

Hi all, 

I use this coding to filter Gallery but i want to add a new condition to the code but it doesn't accept and give error 

 

First(Filter(UserBOS3Years,MailOfUser=User().Email)) 

 

i Want to add another condition that the "  Entries Column Equal 0 " , How to do that ?? 

 

Capture.PNG

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @MostafaGamal 

    It is not clear to me what you want to accomplish here.  Your screenshot shows what appears to be a form in the top of the screen and a gallery under it.  1) Are you looking to add new items to a datasource called UserBOS3Years and show them in your gallery?  2) Are you looking to edit items in your gallery?  Please address these two questions.  

    FYI with respect to the gallery:
    First(Filter( is equivalent to Lookup() and will result in only one record in your gallery. If you add a second condition and it doesn't match  entries = 0, then nothing will show in the gallery. 
    Zero is not the same as IsBlank() or = "" and your filter address the type of data in the "entries" column. 

     

  • MostafaGamal Profile Picture
    on at

     

    @Drrickryp  thanks for your response, I would like to update SP items in forms based on the gallery filter as i made items in Form Gallery1.selected 

     

    I use First(Filter to show the first row that achieve the conditions in the filter used in gallery 

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @MostafaGamal 

    Your conditions appear to be static.  If you are not selecting from items listed in your gallery, you may as well set the Item property of your Form to 

    First(Filter(UserBOS3Years,MailOfUser=User().Email)) && entries = 0

    and forget about the gallery.  If you match both conditions, the form will show data.  If either condition does not match, then the form will be blank.  It seems pointless to have a gallery that only shows one item.

  • Verified answer
    v-yutliu-msft Profile Picture
    on at

    Hi @MostafaGamal ,

    Firstly, if you want to use multiple multiple condition to filter, the syntax should be like this:

    FilterTablecondition1,condition2,....)

    LookUp(Table, condition1&&condition2&....)

    So in your issue, you could use these  formulas:

    First(Filter(UserBOS3Years,MailOfUser = VarUser.Email,Entries= 0 )) 
    LookUp(UserBOS3Years,MailOfUser = VarUser.Email&&Entries= 0 )

     However, I've found you posted another issue here:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/how-to-filter-more-than-2000-records-in-powerapps/m-p/629796#M199684

    It seems that your current problem is delegation warning.

     

    To avoid delegation warning, you need to use delegate functions.

    The delegate functions for sharepoint are:

    Item Number Text Boolean DateTime Complex [1]
    Filter Yes Yes Yes No [4] Yes
    Sort Yes Yes Yes Yes No
    SortByColumns Yes Yes Yes Yes No
    Lookup Yes Yes Yes No Yes
    = Yes Yes Yes No [4] Yes
    <, <=,<>, >, >= Yes [2] No No No Yes
    StartsWith - Yes - - Yes
    IsBlank - No [3] - - No

    Since First() is not delegate, LookUp() is delegate, so please use LookUp function.

     

    This formula will be more suitable for you:

    LookUp(UserBOS3Years,MailOfUser = VarUser.Email&&Entries= 0 )

     

     

    Best regards,

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard