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 / Power Apps gallery wit...
Power Apps
Answered

Power Apps gallery with multiple dropdown filters and an IF Statement

(1) ShareShare
ReportReport
Posted on by 80

I have a Power App with a main gallery that filters by three different dropdowns. The filter using the dropdowns works great (picture of current formula attached).

However, I also want to add a conditional filter whereas if the item status = "Draft", I want it to only show that item in the gallery, along with the items filtered by the formula above, if the current user is the one who created the item in SharePoint. I have a variable set OnStart for current users, but I cannot seem to figure out who to weave in that conditional statement into the filter formula within the gallery's Items property. 
 PowerApps_GalleryFilterIssue4.png

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @NewtKris1 

    You would just add the additional criteria to your filter formula.

    It would be like this:

    Sort(
     Filter(Proposals,
     
     IsBlank(DDName.Selected.Result) || Emailforpersonleadingproposal.DisplayName = DDName.Selected.Result,
     IsBlank(DDDivision.Selected.Value) || Ownerofthisopportunityorproposal = DDDisivion.Selected.Value,
     IsBlank(DDType.Selected.Value) || RequestType = DDType.Selected.Value,
     ItemStatus = "Blank"
     ),
     Submissiondeadline
    )

     

    A few things:

    1) You were using SelectedText on your dropdown controls - that is a deprecated property and should be avoided.  In the above formula, I have replaced it with the proper .Selected  However, the .Value that follows may or may not be a valid column of your dropdown.  So, replace that with the appropriate column name if necessary.  If you are not sure, then share the Items property formula on those dropdowns.

     

    2) You did not mention the name of type of column that will hold the draft status.  In the above, it is considered to just be a text column.  If it is a choice column, then change the above with the proper name of the column and add a .Value to the name.

     

    3) You made mention of the user being identified in the OnStart, but you did not mention what you want to do with that in regard to your formula.

     

    Please clarify any of the above.

     

    I hope this is helpful for you.

  • NewtKris1 Profile Picture
    80 on at

    Thank you for your response!

     

    I’ll update the formula to reflect .selected instead of .selectedtext. Thank you!


    The status column is a text column in SharePoint. The user variable set at OnStart is used throughout the app and I was thinking it would be useful to match the items with a status of “Draft” where the item creator is the current user.

     

    In your formula example, I don’t see how it is filtering items where the status is “Draft” and the current user = the item creator. Am I missing something?

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @NewtKris1 

    Yes, you are missing seeing that because I was not clear on what you wanted from your post.

     

    Can you clarify just a little more on this?

    Are you stating that you want your gallery to ONLY show items that are Draft for the current user?  Or are you stating that the gallery should show everything except draft, unless the draft is for the current user?

    I'm not clear on your requirement.

    Thanks!

  • NewtKris1 Profile Picture
    80 on at

    Thank you. The latter is correct: the gallery should be filtered by the dropdowns AND show everything except draft, unless the draft is for the current user.

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @NewtKris1 

    Okay, very good.  The final question would be what column in your list contains the user information?

    I am going to assume the Created By column...so replace as needed in the formula below:

    Sort(
     Filter(Proposals,
     ( 
     (IsBlank(DDName.Selected.Result) || Emailforpersonleadingproposal.DisplayName = DDName.Selected.Result) &&
     (IsBlank(DDDivision.Selected.Value) || Ownerofthisopportunityorproposal = DDDisivion.Selected.Value) &&
     (IsBlank(DDType.Selected.Value) || RequestType = DDType.Selected.Value)
     ) || // change this || to && (And) if you want to be inclusive.
     (StartsWith('Created By'.Email, User().Email) && StatusColumnName = "Draft")
     ),
     Submissiondeadline
    )
  • NewtKris1 Profile Picture
    80 on at

    It worked! Thank you! 🙂

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @NewtKris1 

    Excellent!  Happy to help!

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
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard