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 / Filter() and Choices()
Power Apps
Answered

Filter() and Choices()

(1) ShareShare
ReportReport
Posted on by 38

Hi Guys,

 

I am a newbie with Powerapps and has been trying to figure out how to combine Filter with Choices.

 

I have a Gallery called Gallery_1

Item = Choices(powerapps1, suggestedfix)

 

then added a checkbox with code

 

text = ThisItem.Value

 

It works okay, however, the suggestedfix returns every suggested fix, I want it filtered:

 

The usual filter code I use is Filter(powerapps1, category.selected.result=catresult)

 

Any suggestions on how to combine this filter and choice? Expected result should be List of Checkboxes that are filtered based on the catresult.

Categories:
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Verps,

     

    Could you try the code below:

    Filter(
     Choices(powerapps1, suggestedfix),
     Value in ForAll(
     Filter(
     powerapps1,
     category.selected.result=catresult
     ) As Inner,
     Inner.suggestedfix.Value
     )
    )

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • Verps Profile Picture
    38 on at

    Appreciate the response. I assume that I will need to enter this on the Gallery right?

     

    I am getting this error, would you happen to know why?

    Verps_0-1678219258434.png

     

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Verps,

     

    I made a small mistake within the Choices() part of the function (comma instead of dot). Could you try this instead:

     

    Filter(
     Choices(powerapps1.suggestedfix),
     Value in ForAll(
     Filter(
     powerapps1,
     category.selected.result=catresult
     ) As Inner,
     Inner.suggestedfix.Value
     )
    )

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • Verps Profile Picture
    38 on at

    No worries, I actually noticed that and had it replaced but still got the above prompt shared. Is it because how my sharepoint list is created?

  • LaurensM Profile Picture
    12,516 Moderator on at

    Unfortunately, I am not able to recreate the error message on my end.

     

    Could you copy-paste the code that is producing the error?

    Is it only complaining about 'Value' or also about the Choices() code?

     

    Additionally, I tested this with my test SP list and a choice column (no multi selection). Does suggestedfix also refer to a choice column or does it have a different column type?

  • Verps Profile Picture
    38 on at

    Here is the code that that is entered in the Gallery (note that some of the variable names was changed)

     

    Filter(Choices(powerapps1.SuggestedFix), Value in ForAll(Filter(powerapps1, CategoryList.Selected.Result=Cat) As Inner, Inner.SuggestedFix.Value))

      

    and here is the error

     

    Verps_0-1678255628002.png

     

    SuggestedFix is indeed a choice column (allow multi selections)

  • LaurensM Profile Picture
    12,516 Moderator on at

    Thanks for the additional info @Verps,

     

     The multiselect explains the error we are having. I adjusted the formula and tested it with a choice (multi select) column, could you give this a try:

     

    With(
     {
     multChoiceList: Ungroup(
     ForAll(
     Filter(
     powerapps1,
     category.selected.result = catresult
     ) As Inner,
     Inner.SuggestedFix.Value
     ),
     "Value"
     )
     },
     Filter(
     Choices(powerapps1.SuggestedFix),
     Value in multChoiceList
     )
    )

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    @Verps,

     

    Alternatively, the code below will achieve a similar result. (it will be ThisItem.Result instead of ThisItem.Value in your gallery)

    Filter(
     Distinct(
     Ungroup(
     Filter(
     powerapps1,
     CategoryList.Selected.Result = Cat
     ),
     "SuggestedFix"
     ),
     Value
     ),
     Result <> Blank()
    )

     

    Unfortunately, I haven't found a delegable way to limit the code to one Filter() statement. You could combine it in 1 Filter as with the code below. However, the filter will not be delegable. (Causes issues with lists > 2000 records)

    Distinct(
     Ungroup(
     Filter(
     powerapps1,
     CategoryList.Selected.Result = Cat && !IsEmpty(SuggestedFix)
     ),
     "SuggestedFix"
     ),
     Value
    )

     

    I hope this helps!

  • Verps Profile Picture
    38 on at

    Thank you! It is working as intended. It is also working for another same scenario with different variables.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard