Good Morning all
I currently have a gallery that is serving as a checklist which allows users to complete projects if they are finished. I am currently able to update the SP list I have linked (Has 2 columns, ProjectName, CompleteOrActive). When the user checks the box associated with the project he/she wants to complete it adds the item to a collection called projectsList using this formula:
If(
!IsBlank(Filter(Projects, ProjectName = ThisItem.ProjectName)), Collect(projectsList, ThisItem))
and then I have a submit button which bulk updates the SP list using this formula:
ForAll(projectsList, Patch(Projects, LookUp(Projects, ID = projectsList[@ID]), {CompleteOrActive : "Complete"}))
It works and filters out the check list gallery, removing the projects that are marked as complete from the gallery. Considering the user makes a mistake and wants to undo the selections they have made - I have added a button "Undo" with the formula:
ForAll(projectsList, Patch(Projects, LookUp(Projects, ID = projectsList[@ID]), {CompleteOrActive : "Active"})) - which just re-adds all the projects from the collection to the gallery.
I know there has to be a conditional somewhere that removes items from the collection of checked projects so only the ones that have been selected currently to be re-added - just not sure where that should go or what it should look like
Any help is appreciated - sorry for the novel of a problem lol