Scenario: I have a gallery that with thumbs up and thumbs down icons that one can vote on the suggestion submitted. Following is what I have in the app:
- Stand alone canvas app.
- Data connection is SharePoint list.
- OnStart collection = ClearCollect(colvotes, ListName)
- Gallery Items = colvotes
- Two Icons - thumbs up and thumbs down in gallery
Issue: I would like not to have to refresh the whole list, but only have the collection vote piece updated for said Item being voted on.
What has worked when tied directly to the list: My Gallery items = ListName. In my Gallery have two icons thumbs up and down for my Onselect (will us thumbs up): Set(varItem, ThisItem); Set(varvote, UpVote.Run(ThisItem.ID)); Refresh(ListName) When Automate runs the Gallery gets refreshed and shows the correct number of votes for said item. However, would rather not have to do refresh for right now its quick but say list gets to be 2K big it will be slower to run.
What isn't working when I change things to a collection: I have set for the Gallery items = colvotes. For my Thumbs up icon Onselect = Set(varitem, ThisItem); Set(varvotes, UpVote.Run(ThisItem.ID)); UpdateIf(colvotes, ThisItem.ID = varitem.ID, {Voting: varvotes.voting})
In my automate its got the response to Power Apps so I can get back the voting number for said item. However, what takes place with the one not working for me is it updates all my Gallery ThisItem.Voting fields through the whole Gallery. Example first gallery item has 10 votes second gallery item has 3 votes. I upvote the first gallery item which then makes it to 11 as it should, but my second gallery item now shows 11 too. It doesn't change what is stored in SharePoint list, which is what I want in Power Apps to see the updated number, just changes what is shown in Gallery.
I feel like I'm close and on the right track just got to end of day after doing various try's and at a stuck point.
Thank you for taking a look 😊