Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Showing items in gallery which are not part of a second sharepoint list

(0) ShareShare
ReportReport
Posted on by 187

Hi all,

I have the following scenario. A sharepoint list of mine contains news records. So each row in the list represents one news article.
Each article will get its automated ID from Sharepoint by default, but I also have a column named NewsIdentifier which I fill myself with a unique value.

I want to display these articles in a gallery. Assume the list is named News, the Items property of my gallery will be News.

Now I want to introduce a 2nd gallery, which will always show all items from the News list, so no filters whatsoever. So the Items property is set to News, just like initially the first gallery. 

When a user selects an article from the first gallery, e.g. NewsIdentifier 1 and marks it as read (by pressing a button which will Patch the NewsIdentifier to a second sharepoint list named NewsRead in a column named NewsID) I want the gallery 1 to no longer show that article since it's identifier is now part of NewsArchive.

So it needs to filter somehow like Filter(News,LookUp(NewsArchive, NewsID <> NewsIdentifier))

However, I want to avoid any delegation issues. Hopefully I explained things a bit clearly, is there any way to achieve this?
Since overtime my newsarticles will be > 2.000 and I want gallery 1 to only show items which have not been marked as read yet and gallery 2 should always contain all articles (and I will introduce some search fields later to help the user narrow down the articles).

Any ideas? Many thanks in advance.

  • elseb Profile Picture
    elseb 758 on at
    Re: Showing items in gallery which are not part of a second sharepoint list

    good luck!

     

    Seb

  • debarbanson Profile Picture
    debarbanson 187 on at
    Re: Showing items in gallery which are not part of a second sharepoint list

    thanks, gonna give that a go later this weekend, will let you know if I managed

  • elseb Profile Picture
    elseb 758 on at
    Re: Showing items in gallery which are not part of a second sharepoint list

    It won't, collect it with filter and "=" those are delegable clearcollect(colAchived, filter(achivedList, user_id = varSelectedUser.user_id)) and you will have a collection containing all the id's for the articles archived by this user. This will also allow you to unarchive the articles by just patching "remove" record from that list

     

    Seb

  • debarbanson Profile Picture
    debarbanson 187 on at
    Re: Showing items in gallery which are not part of a second sharepoint list

    Was thinking about that as well, but then delegation would kick in for the collection right?

  • elseb Profile Picture
    elseb 758 on at
    Re: Showing items in gallery which are not part of a second sharepoint list

    yes, 0-1 would only work it it was for everyone, in your case you'd need to also find something distinct for each user and check against that, maybe a stretch but if you create another entire list and patch uid of the user in one and the id of the archived article in another that way you can create a collection for the user logged in and filter the galleries by checking against that collection.

     

    Seb

  • debarbanson Profile Picture
    debarbanson 187 on at
    Re: Showing items in gallery which are not part of a second sharepoint list

    Hi Seb, many thanks for your suggestion. Just noticed that I forgot to mention one thing.
    The newsarticles list is like a Masterlist, which will be seen by many different users. So I need to store it per user if an article has been read yes/no. 
    I might overcomplicate my thinking but I believe the 0 - 1 filter will only work if you don't need to make that distinction right?

  • elseb Profile Picture
    elseb 758 on at
    Re: Showing items in gallery which are not part of a second sharepoint list

    Consider adding a number column e.g. is_archived set it to default 0 and when patching the news to archive do is_archived:1.

     

    then one list set to Filter(list, is_archived = 0) and the other to 1

     

    Seb

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard