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 / How to filter a galery...
Power Apps
Answered

How to filter a galery by an other galery using a variable?

(1) ShareShare
ReportReport
Posted on by 77

Hi everyone,

 

I have two galeries each using a sharepointlist for its data. 

gallerygallery

The left gallery takes data from here 

sharepointlistsharepointlist

I tried the same list in two different variations (Text vs Boolean) for the right galery.

sharepointlistsharepointlist

465132_4-1683722575059.png

I want to click on an item in the left galery to filter the right galery.

At the moment I am able to filter the right galery manualy : Filter(Anzeige; 'Preisänderungen' = true)

I set a global variable(onSelect left galery:Set(var1;GallerySzenarien.Selected.Titel)) to replace the "column to filter".

I tried to filter with var1 Filter(Anzeige; var1 = true)

 

Filter() seems not to work with var1 as an argument. I get the error: A text can not be compared to a boolean.

 

What should I do? Thanks in advance

 

Edit: The rows of the first list are the columnames of the second.

 

 

 

 

Categories:
I have the same question (0)
  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    Hi @465132,

     

    Which data type are you using for columns such as neuer Hersteller, etc?

    For example, Text, Yes/No (or Ja/Nein), etc:

    KeithAtherton_0-1683723951169.png

     

    Also, does the filter work using a text comparison like this?:

    Filter(Anzeige; var1 = "Ja")

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

  • 465132 Profile Picture
    77 on at

    Hi KeithAtherton,

     

    I tried both the Text and Yes/No data type.

    In Anzeige the data type is Yes/No.

    I made copy of Anzeige and named it Anzeige2. Anzeige2 is using the text data type.

     

    There is no error after with  

    Filter(Anzeige; var1 = "Ja")

    But it does not find a matching dataset.

     

    Same for Anzeige2.

     

  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    If you select var1 in the formula bar, what is the value please?

     

    Also, can you select Anzeige and Anzeige2 to view the data (without filter applied) and share the screenshots please?


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

  • 465132 Profile Picture
    77 on at

    465132_0-1683725374246.png

    The Value is "Kundenbindung" because it is the last selected element. It changes to the title of the elements.

    465132_1-1683725497735.png465132_2-1683725549902.png

     

     

  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    Thanks. If you open the formula bar and select Anzeige (and Anzeige2), there will be a dropdown to display the data in the collection like this:

     

    KeithAtherton_0-1683726080070.png


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

  • 465132 Profile Picture
    77 on at

    465132_0-1683726384822.png

    465132_1-1683726411108.png

    Yes that is right

  • Verified answer
    KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    Thanks. I see, so this hard-coded code works:

    Filter(Anzeige; 'Preisänderungen' = true)

     

    But this code does not - looks like a collection column name cannot be swapped with a hard-coded text value:

    Filter(Anzeige; var1 = true)

     

    An alternative approach could be using code similar to this for the right gallery data source Items property, if this level of hard-coding is acceptable:

    Switch(var1,
     "neuer Hersteller", Filter(Anzeige, 'neuer Hersteller'),
     "neues Produkt", Filter(Anzeige, 'neues Produkt'),
     // etc
    )

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

  • 465132 Profile Picture
    77 on at

    Thanks a lot! Now it works fine.

  • KeithAtherton Profile Picture
    3,709 Most Valuable Professional on at

    Great news! My pleasure. Thanks for the update.


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
    Follow me online.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 475

#2
WarrenBelz Profile Picture

WarrenBelz 387 Most Valuable Professional

#3
11manish Profile Picture

11manish 289

Last 30 days Overall leaderboard