Good evening, everyone.
I am putting together an app that displays a list of content in a vertical gallery. I would like for each user to be able to mark their own favorite or bookmarked content within the gallery and be able to access it the next time they load it up.
I would like to use the bookmark icon to make things easy. My thought was to add a people column to the SharePoint list that is the data source for the gallery. When someone clicks on the bookmarker and it's not currently highlighted, it would add that person (the current user) to the people column for that entry. Similarly, the gallery would read who is in the people column and if it contains the current user, it would show as already bookmarked. Hopefully, that makes sense.
Would this be the best way to implement a favorites option and if so could you provide some assistance with the patch code to log the current user into the SharePoint people column? Tried to find some tutorials but they don't match up to what I am looking for.
If there any recommended alternative methods, I would be open to those as well.
Always appreciate all the help everyone here provides!
I haven't been successful making the patch to a person column yet. Getting a network error.
That was it. I had tried that previously and it didn't work but the issue is apparently with the SharePoint. If I change the column setting it works fine. But that's a whole different issue.
I just looked into it, patching to a people column requires a record schema with more fields.
See below. If you need those additional fields go for it, but if all you need is the users email, I'd recommend changing the column to a Text field and use the patch like we have it.
Also a link below to where this info came from.
PATCH A SharePoint Person Column In Power Apps - Matthew Devaney
Unfortunately, it still does not work. Used the following formula since I changed the name of my People caolumn to MaxPeeps.
Patch('Test Library List', ThisItem, {MaxPeeps: Text(User().Email)})
The error that I received was a mis-matched type. Expecting Record and received TEXT.
I had to test it out. Use ThisItem and try {People:Text(User().Email)}
Sorry about the late response, wound up going out of town just after sending this.
I tried the formula above and wound up with the following error message I did change the data source and column reference to the correct names.
Name isn't valid. 'ThisRecord' isn't recognized..
I tried ThisItem instead and got a type match error instead saying that it was expecting a table.
Try this patch code in the OnSelect of the bookmark icon. Patch( SharepointList, ThisRecord, { People: User().email } )
WarrenBelz
146,780
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,093
Most Valuable Professional