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.
good luck!
Seb
thanks, gonna give that a go later this weekend, will let you know if I managed
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
Was thinking about that as well, but then delegation would kick in for the collection right?
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
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?
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