Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Filter Gallery From Form Selection

Like (0) ShareShare
ReportReport
Posted on 13 May 2021 06:13:55 by 21

Hello All,

I have a form with multiple dropdown choices, "Form1".

The drop downs are named DataCardValue1,2,3,4 etc.

I need those drop downs which exist within that form to filter a gallery, "Gallery1".

If all 4 drop values match a row in the Gallery then only that row's value should be shown in the gallery.

If all 4 drop down values do not match, or any number of the drop downs have not yet been selected then the gallery should remain blank.

So only once all 4 values have been matched should the gallery display anything.

 

I'm really stuck on what the arguments should be to make this happen. I've tried If functions and Filter funcitions but i'm not getting anywhere.

 

How should I approach this? Any help would be appreciated.

Thanks in advance.

Categories:
  • Mike2020 Profile Picture
    21 on 13 May 2021 at 09:02:43
    Re: Filter Gallery From Form Selection

    Thanks Qi,

    You were 99.9% Correct.

    Just for others viewing this;

    'YourDatsource' has the commas either side.

    And the last && was actually )) for my use case.

    Column1.Value and Column2.Value wouldn't let me have the ".Value" part of it. It ends up being just Column1 and Column2. Both 3 and 4 allowed .Value

    This might be due to the column type. Columns 1 and 2 in my SharePoint list are text, Columns 3 and 4 are a text but are choice format. 

     

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on 13 May 2021 at 08:07:23
    Re: Filter Gallery From Form Selection

    Hi @Mike2020,

    Do you want to filter the Gallery1 based on the Form1?

    Could you please tell that:

    1. how you set the Item property of the Form1?
    2. are DataCardValue1,2,3,4  are all Combo Boxes?
    3. what is your data source, SP list or Dataverse?
    4. do these 4 drop down selected correspond to 4 columns in your data source, what is the column type, Choice?

    I am confused why would you like to filter the Gallery1 based on the Form1, we used to filter the form based on the Gallery1.Selected, please provide more details.

    Please provide the above details.

    Generally, if you have 4 Choice columns and 4 Combo Box, you could try the formula set on the Items of the Gallery1:

    If((!IsBlank(DataCardValue1.Selected.Value) || !IsEmpty(DataCardValue1.Selected.Value))
    &&(!IsBlank(DataCardValue2.Selected.Value) || !IsEmpty(DataCardValue2.Selected.Value))
    &&(!IsBlank(DataCardValue3.Selected.Value) || !IsEmpty(DataCardValue3.Selected.Value))
    &&(!IsBlank(DataCardValue4.Selected.Value) || !IsEmpty(DataCardValue4.Selected.Value)),
    Filter(YourDateSource,Column1.Value=DataCardValue1.Selected.Value && 
     Column2.Value=DataCardValue2.Selected.Value &&
     Column3.Value=DataCardValue3.Selected.Value &&
     Column4.Value=DataCardValue2.Selected.Value &&
     )

    Hope it could help you.

    Regards,

    Qi

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,662 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started