Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Filter gallery based on dropdown [afresh]

(0) ShareShare
ReportReport
Posted on by 361

need to filter the gallery based on these choice boxes, but I don't know how I can do it.

 

in my scenario I have a gallery (APS Request) that show this data, the "Site" column needs to be filtered in the choices box, however, the site column in sharepoint is of the CHOICES style.

 

Joaoandrebs_0-1678579678047.png

 

Another thing I need to filter is the Status column, which is also a choice column (I don't know why, I didn't create the app).

Joaoandrebs_1-1678579678350.png

 

Joaoandrebs_2-1678579678351.png

 

 

Categories:
  • Drrickryp Profile Picture
    Drrickryp on at
    Re: Filter gallery based on dropdown [afresh]

    @Joaoandrebs 

    If it answered your question, please mark it as solved.

  • Drrickryp Profile Picture
    Drrickryp on at
    Re: Filter gallery based on dropdown [afresh]

    @Joaoandrebs

    IF you are using dropdown controls, make sure to set the default property to Blank() and the button OnSelect to

    Reset(Dropdown1);; Reset(Dropdown2) 

  • Joaoandrebs Profile Picture
    Joaoandrebs 361 on at
    Re: Filter gallery based on dropdown [afresh]

    @Drrickryp 

     

    Oh right, hadn't realized this.

    now, last thing (promise)

    I put this formula to the dropdown because it makes more sense... but I want to leave an option to "reset" the selected items, for example: a button that "erases" the choices "Requested" and "SJC"

     

    Joaoandrebs_0-1678648216752.png

     

  • Drrickryp Profile Picture
    Drrickryp on at
    Re: Filter gallery based on dropdown [afresh]

    @Joaoandrebs 

    There was a typo in my formula and if you are using only two comboboxes for Choice type fields that are single select type then this should work.:

     

    Filter(
     'APS Request', Len(ComboBox1.Selected.Value)=0 ||
     Site.Value = ComboBox1.Selected.Value, 
     Len(ComboBox2.Selected.Value)=0 ||
     Status.Value = ComboBox2.Selected.Value
     
    )

     

  • Drrickryp Profile Picture
    Drrickryp on at
    Re: Filter gallery based on dropdown [afresh]

    @Joaoandrebs 

    The above filter should work if both comboboxes have choices, if either one has a choice and if both are blank, all the records should show.  Please post the text of the current items of your gallery.

  • Joaoandrebs Profile Picture
    Joaoandrebs 361 on at
    Re: Filter gallery based on dropdown [afresh]

    @Drrickryp , 

     

    the filter worked.

    however, would it be possible to filter through the two comboboxes?

    example: filter by selection value of the 2 simultaneous comboboxes? so it will be grade 10.

     

    Joaoandrebs_0-1678642964608.png

     

  • Verified answer
    Drrickryp Profile Picture
    Drrickryp on at
    Re: Filter gallery based on dropdown [afresh]

    @Joaoandrebs 

    I am assuming that the information applies to all of your combobox controls.  ie. single selection, allows blank.  You do not need the "in" operator for single selection comboboxes.  Besides, this operator is not delegable in SharePoint and will always give a warning. 

     

    Filter(
     'APS Request', Len(ComboBox1.Selected.Site)=0 ||
     Site.Value = ComboBox1.Selected.Value, 
     Len(ComboBox2.Selected.Value)=0 ||
     Status.Value = ComboBox2.Selected.Value
     Len(ComboBox3.Selected.Value)=0 ||
     someotherchoicecolumn.Value=ComboBox3.Selected.Value
    )

     

     

     

  • Joaoandrebs Profile Picture
    Joaoandrebs 361 on at
    Re: Filter gallery based on dropdown [afresh]

    @Drrickryp 

    I tried this, but 

    I want it to receive more than one filter, which doesn't filter just by the "site" column, understand?

    And if possible without that dataset refusal warning...

     

    Joaoandrebs_0-1678634300349.png

     

  • Joaoandrebs Profile Picture
    Joaoandrebs 361 on at
    Re: Filter gallery based on dropdown [afresh]

    @Drrickryp 

     

    Combobox - single select 

     

    Yes, my list is APS Request  - yes

     

    like this image: 

     

    Joaoandrebs_0-1678627744215.png

     

  • Drrickryp Profile Picture
    Drrickryp on at
    Re: Filter gallery based on dropdown [afresh]

    @Joaoandrebs

    Combobox's or dropdown? If comboboxes, single or multiselect?

    Name of list, 'APS Request'? Allow blanks in choices? 

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard