cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MrNguyen
Level: Powered On

Using a dropdown to filter a gallery

Good morning!

 

I have a gallery which gets filtered by a few dropdown items: GM, ERP, Module. The code below is currently working as expected:

SortByColumns(
    Filter(_L1Records,
        If(!IsBlank(dropGM.SelectedText.Value), GM = dropGM.SelectedText.Value, true) && 
        If(!IsBlank(dropERP.SelectedText.Value), ERP = dropERP.SelectedText.Value, true) && 
        If(!IsBlank(dropModule.SelectedText.Value), L1_Type = dropModule.SelectedText.Value, true)
        ),
    "GM", Ascending
)

gallery_itemsProperty.png
From within the gallery I have two text labels called validate_Diff_vs_Recon and validate_Unrecon_vs_Prov which returns either "Yes" or "No". On the outside of the gallery I have a new dropdown object called dropMismatchType and I'd like to filter the gallery for where either the text labels are "No".  I have tried this and it's giving me a circular reference error:

    SortByColumns(
        Filter(_L1Records,
            If(!IsBlank(dropGM.SelectedText.Value), GM = dropGM.SelectedText.Value, true) && 
            If(!IsBlank(dropERP.SelectedText.Value), ERP = dropERP.SelectedText.Value, true) && 
            If(!IsBlank(dropModule.SelectedText.Value), L1_Type = dropModule.SelectedText.Value, true) &&
            If(dropMatchType.SelectedText.Value = "Mismatch", Filter(g_Summary.AllItems, validate_Diff_vs_Recon.Text = "No" || validate_Unrecon_vs_Prov.Text = "No"))
            ),
        "GM", Ascending
    )

Is there a way for me to filter / search based on a field value within the gallery? Any help would be greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Using a dropdown to filter a gallery

You can't reference the items in the gallery to filter_L1Records to create the items that go into the gallery.  If the labels for data for validate_Diff_vs_Recon and validate_Unrecon_vs_Prov are referencing columns in _L1Records then you should be able to use those columns in the Filter formula.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

1 REPLY 1
Super User
Super User

Re: Using a dropdown to filter a gallery

You can't reference the items in the gallery to filter_L1Records to create the items that go into the gallery.  If the labels for data for validate_Diff_vs_Recon and validate_Unrecon_vs_Prov are referencing columns in _L1Records then you should be able to use those columns in the Filter formula.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,958)