I'm really racking my brain on how to figure this out. I have a few collections that retrieve teams meeting data from. The one collection stores the attendees to the meetings and displays this information within a gallery. When someone selects one of the attendees it sends the info to a SharePoint folder. I then have a sign-out page with a gallery that shows the "signed in users" and updates the SharePoint with the information. My problem is I have no way to remove the attendees from the collection after they have signed in. I need to iterate through the name column of both collections and if a match is found only remove it from the attendee collection as that's the one that's displaying the data
Any help is greatly appreciate thank you!
No worries and glad I could help.
Mike thank you so much you have saved me thank you for dealing with my stupidity
Actually let me make it simpler
this example loops through all items in Gallery1 and removes values from a collection if the VisitorName value in the collection is equal to the current item in the loop ThisRecord.VisitorName
ForAll(Gallery1.AllItems,
RemoveIf(CollectValues, VisitorName = ThisRecord.VisitorName);
);
please note I am answering based on what you typed.
now you just one a single loop and it will remove if it exists.. if not it does nothing and you dont need to loop through the second at all
This is a really good idea I'm trying to implement this now and just a little confused
So on true (meaning is found a match) I want to remove that value from the collection connected to the gallery, what am I doing wrong?
Yes, you would need unfortunately though do a double loop or you can do a single loop (outer) and do a lookup against the AllItems in the second. Either way it would do what you just asked.
// Two Galleries, I aliased them as A and B
// Then since its a copy and paste you can see Title1 and Title1_1 where i compare the text
// you compare whatever you want
ForAll(Gallery1.AllItems As A,
ForAll(Gallery2.AllItems As B,
If(A.Title1.Text = B.Title1_1.Text, true, false);
// do whatever you are gonna do in the If above
)
)
but I cannot tell if you are already doing this or not. But thats one way to do this.
Cheers,
-Michael
Please Kudo or Select as Answer if it helps or solves your issue
I was just trying to explore my options. What I have working is this function: RemoveIf(CollectValues, VisitorName = SignOutGalleryNew.Selected.Title). Which removes the matched name from the Collection with the name if its present within the sign outlist. Obviously the problem is its only gonna just remove the default selection of the sign out list so having over 1 name breaks it. Is there a way to iterate through the gallery items so it compares the VisitorName in the collection to those in the sign out list?
There is no compare of 2 galleries. What would it compare?
You have to provide to glue in between since you are the one defining the incoming Items values.
And in your case you are saying its based on a SharePoint list, but you cannot remove an item from a Gallery that is based on a list unless you modify the list to no longer have that.
What you want isn't hard, but your looking for an easy button, I couldn't easy button it any better in C/C++ or C# directly.
You can use the AllItems property to validate if things exist in each, but you said remove them, thats a different story.
Yeah I like this idea just the implementation seems hard like realistically I want to just be able to compare the SignIn gallery to the signout gallery and filter it that way but no matter what I do that isn't working. I think its because the signin gallery is based off a collection where the signout is based off a sharepoint list. Regardless, i feel very defeated lol
You can always recalculate your collection after you remove one of the elements.
If you have an attribute say 'SignedIn' that can have 'Yes' or 'No' then you would show in your first collection only the ones that have 'SignedIn' = 'No'.
Then when you select one entry in order to sign in you set the attribute to 'Yes' and recollect your collection.
The second gallery only shows the ones from a second collection filtered with 'SignedIn' = 'Yes'. So you have to recalculate this collection as well upon signing out from the first gallery.
You have to again recalculate both collections when you sign out one of the entries from the second gallery (set 'SignedIn' to 'No' again).
The problem still is, how to trigger a recalculation of the galleries when an entry is made from another action (real time).
If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.
If you like my response, please give it a Thumbs Up.
Tricky 😉
Maybe you have to separate the invited attendees (= realtime Teams data) from the users who have actually "Signed in" from your app.
Keep the functionality to update to "Signed in" (in "real time" collection) onSelect of SignIn-Button
Add another datasource/collection and separately store attendees who sign in there.
Use this new collection as reference for your sign out gallery
Remove them from the new collection, when they sign out and update their status to Signed Out (in "real time" collection)
------------------------------------------------------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.
If you like my response, please give it a Thumbs Up.