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 / hiding records from a ...
Power Apps
Answered

hiding records from a gallery depending on two lists

(0) ShareShare
ReportReport
Posted on by 31

Hi all,

 

I am making a sharepoint site for people to view what training they have been set and a way for them to request this training. In this I am using PowerApps to help.

 

I have a page that has Gallery2 on, gallery 2 shows all the training jobs for there level and from there they can select a training job and press a button to request it. Once the button is pressed PowerApps pulls all the information in to a sharepoint list called 'Request tracker'.  Gallery2 is based off a list called 'all training' and has a small filter on so only shows the training for the users level.

 

My question is they anyway that I can hide the jobs the user has already requested? 

 

im thinking I should be able to search the request list by users name and then hide all the training jobs that have the users name next to them, but I have no idea where to start.

 

Any help would be great, thanks in advanced. If anyone needs more information please let me know.

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Could you please share more details about your scenario? Since you have TWO SharePoint list, what column types are those columns of the two lists?

     

    As per your description, I assume that you have a “all training” list that includes all training jobs in Title column, as well as a “Request tracker” list includes a LookUp column “training jobs” and a Person or Group column “user”:

    v-jefferni_0-1615878623488.png

     

    v-jefferni_1-1615878623491.png

     

    Then you could achieve your need as follow steps:

    1\ OnVisible of the Screen, set a variable of current user and create a collection that contains all training jobs that current user have requested:

    Set(varUser, User());
    ClearCollect(colTracker, Filter('Request Tracker', user.DisplayName = varUser.FullName).Jobs);
    ForAll(colTracker,Collect(colJobs,ThisRecord.Jobs))

     

    2\ In Items of the Gallery, Filter the list to exclude training jobs that in the collection:

    Filter('Training Jobs',Not(Title in colJobs.Value))

     

    Since I'm using the account "Test3", the returned result would be as follows:

    v-jefferni_2-1615878623493.png

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • lolbird1212 Profile Picture
    31 on at

    Hi, 

     

    Thank you for the help but I am still having issues. The collection isn't pulling data therefor the gallery is just blank.

     

    Any ideas on this?

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @lolbird1212 ,

     

    Need to know more details about your list and columns, do you have Person and LookUp columns in the list? 

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • lolbird1212 Profile Picture
    31 on at

    Hi @v-jefferni 

     

    The first list I am using, lets call it list A is the list of the training jobs with what level they apply to and both columns are single line of text(picture below). And List B is where all the training requests are saved. I want to search List B by the users name and hide all the jobs that the user is trained in from the gallery.

     

    So in all I need to filter the gallery (Connected to list A) and hide all jobs marked as complete.

     

    List B.PNG
    List A.PNG
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @lolbird1212 ,

     

    Basically the same as my test scenario, then it should work with my formulas. Since you also want to filter completed jobs, you will need to add another condition in the filter function in step 1, like below:

    Set(varUser, User());
    ClearCollect(colTracker, Filter('Request Tracker', user.DisplayName = varUser.FullName, Status.Value = "Completed").Jobs);
    ForAll(colTracker,Collect(colJobs,ThisRecord.Jobs))

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • lolbird1212 Profile Picture
    31 on at

    Hi @v-jefferni   

    Appreciate all the support and for you taking time out of your day.

     

    I am having issues with the collection, I feel as something is going wrong and nothing is being collected therefor the gallery is not being filtered by anything.

     

    see pictures for how I've had to adapt the code to make it work and for the empty collection.

     

    Do you know why this could be happening?

    Gallery.PNG
    collection.PNG
    OnVis.PNG
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @lolbird1212 ,

     

    I found that the Person column in your list is named as "Person", so it should be:

    Set(varUser, User());
    ClearCollect(colTracker, Filter('Request Tracker', Person.DisplayName = varUser.FullName, Status = "Completed").Jobs);
    ForAll(colTracker,Collect(colJobs,ThisRecord.Jobs))

    User().FullName = varUser.FullName make no sense like 1=1

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

     

  • lolbird1212 Profile Picture
    31 on at

    hi @v-jefferni 

     

    Thank you for this, the collection is now working but it is not filter the gallery. Any ideas on this?

     

    See below

    collection1.PNG
    gallery3.PNG
    gallery1.PNG
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @lolbird1212 ,

     

    Sorry for the delay.

     

    Once encountered this kind of issue, you could try to test it with narrowing down the conditions to check if any of the conditions in the Filter Function is correct.

     

    In this case, I am wondering that if the Level condition caused the issue. So if the Level column is a Choices type column, please first modify the formula to below to make sure the condition is correct:

    Filter('Criteria for level', Level.Value = Dropdown3.Selected.Value)

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @lolbird1212 ,

     

    Have you resolved the issue? 

    If above post helps, then please consider Accept it as the solution to help the other members find it.


    Best regards,
    Community Support Team _ Jeffer Ni

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

#2
11manish Profile Picture

11manish 141 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard