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 gallery1...
Power Apps
Unanswered

How to filter gallery1 base on gallery2 toggle values

(0) ShareShare
ReportReport
Posted on by 61

Hello

 

I have 2 galleries

Gal1                                                                 Ga2

Nametoggle NameVar
Worker 1false Worker 189
Worker 2true Worker 254
Worker 3false Worker 323

 

in my Gallery2 i want to filter all data data that have a "true" value in the toggle input (How ever since the toggle button is a seperate button - im having problem coming with a sulotion).

Is there anyone with a sulotion?

 

This is the outcome i want

NameVar
Worker 254

JohnMarkPerez_0-1699460109785.png

 

Categories:
I have the same question (0)
  • M_Ali_SZ365 Profile Picture
    1,110 on at

    Hi @JohnMarkPerez 

    To show only the workers with the toggle set to true in your second gallery, do the following:

    1. Ensure each worker's name is unique.
    2. Use a filter on Gallery2 that checks the toggle status in Gallery1.

    Here's a crisp version of what your formula might look like:

     

    Filter(
     Gallery2.AllItems,
     LookUp(Gallery1.AllItems, Name = Gallery2ThisItem.Name).toggle.Value = true
    )

     

    What this does is, for each item in Gallery2, it looks up the corresponding worker in Gallery1 and checks if the toggle is true. If it is, it keeps the worker in the view.

    Paste this formula in the Items property of Gallery2, and it will update your gallery to only show the workers who are marked 'true' in Gallery1. Make sure to replace toggle with the actual name of your toggle control in Gallery1.

    Please accept this solution if it resolves the issue.
    Best regards,
    Muhammad Ali

     

  • JohnMarkPerez Profile Picture
    61 on at

    Hello 

    i think something is missing here!?

    Gallery2ThisItem.Name

     

  • M_Ali_SZ365 Profile Picture
    1,110 on at

    Hi @JohnMarkPerez ,

    To ensure Gallery2 shows only the entries with "true" toggles from Gallery1, use a Filter function. Your Gallery2 items formula should look something like this:

     

    Filter(Gal1, toggle.Value = true)

     

    This assumes that toggle is the name of the toggle control in Gallery1 and Gal1 is the name of the items in Gallery1. The Value property is used because the toggle control's value is a boolean.

    Now, in the items property of Gallery2, you can refer to this filtered set:

     

    Filter(Gal1AllItems, toggle.Value = true)

     

    eplace Gal1AllItems with the actual name of the collection or data source used in Gallery1. This way, Gallery2 will display only the entries where the corresponding toggle in Gallery1 is set to true.

    Please accept this solution if it resolves the issue.
    Best regards,
    Muhammad Ali

  • M_Ali_SZ365 Profile Picture
    1,110 on at

    Hi @JohnMarkPerez 

    1. Gallery2ThisItem is a context variable that represents the current item being evaluated in Gallery2.
    2. .Name is then used to access the "Name" property of that current item in Gallery2.

    Please accept this solution if it resolves the issue.
    Best regards,
    Muhammad Ali

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard