web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / hiding records from a ...
Power Apps
Unanswered

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
    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
    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.

     

  • v-jefferni Profile Picture
    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?

  • v-jefferni Profile Picture
    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

  • v-jefferni Profile Picture
    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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard