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 / Gallery not to show re...
Power Apps
Answered

Gallery not to show records depending on condition

(0) ShareShare
ReportReport
Posted on by 728

Hello,

 

I have a gallery which displays records from an SP List called 'LDR_Light', each item listed has a button that will patch details to another SP List called 'LDR_Light_Test'.

 

Once this button has been pressed and the information patched, I want that record to no longer be visible in the gallery until the next month.

 

The SP List 'LDR_Light_Test' records that the light has been tested, it collects the following info:

 

Year

Month

Test

MasterID

Date Tested

Initials

 

The MasterID is the ID of the record that is stored in the SP List 'LDR_Light'.

 

Scenario I am looking for is if there is not a record in LDR_Light_Test that matches the ID, current year and month, then record to display.

 

If there is a record where MasterID = ID, and also current year and month, then record to not display.

 

I hope that makes sense.

Categories:
I have the same question (0)
  • Silvester. Akakpo Profile Picture
    783 on at

    Hello @neill_long ,
    Kindly try this 

    Filter(LDR_Light,ID in [@LDR_Light_Test].MasterID And Month in [@LDR_Light_Test].Month And Year in [@LDR_Light_Test].Year)

     

  • neill_long Profile Picture
    728 on at

    Unfortunately this is not working for me.  The Month and Year are not fields which are stored in the LDR_ Light SP List.

     

    These are just labels that I have added to the gallery record to display year and month to show what data will be patched to SP List LDR_Light_Test.

     

    Not sure if this is what would cause the formula to not work.

     

    The labels are simply called Year and Month so have tried Year.Text and Month.Text but that too is not working.

  • Verified answer
    neill_long Profile Picture
    728 on at

    Made a small change and added month and year to the SP List LDR_Light.

     

    I was then able to filter the gallery with the formula @Silvester provided.

     

    I made a slight change to the formula so it will show records where id, year and month is not in SP List LDR_Light_Test:

     

    Filter(
     LDR_Light,
     Not(ID in [@LDR_Light_Test].MasterID And Not(Month in [@LDR_Light_Test].Month And Not(Year in [@LDR_Light_Test].Year)))
    )

     

  • neill_long Profile Picture
    728 on at

    @Silvester 

     

    I thought I had it fixed but I have amended the Month in SP List LDR_Light to say August, the record in LDR_Light_Test I have kept as September.

     

    The gallery is not displaying the record even though the condition states to filter if ID, Year and Month is not in LDR_Light_Test.

     

    Am i missing something in my formula?  Every Month the lights get tested so there will always be a record with a matching ID, but should show if there is not a matching Year and Month.

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 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard