cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BigTex
Helper I
Helper I

Removing items from gallery conditionally making changes at the datasource.

Hello,

 

I have a gallery (datasource in Sharepoint) that is filtered according to the person logged in as the source contains a person filed associated with each entry. It looks like this:

image.png

What I am trying to do is ask people if they are still part of a Committee. If they click on "I am no longer part of this committee", it should remove that entry from that datasource and also from the gallery (Which I am able to accomplish).

 

When people click on "Yes, I am still in", it should remove that item from the gallery (giving user the feeling that they have tackled that entry) but not from the datasource. This is what I am having trouble with.

 

Any ideas?

 

Thank you in advance

 

@Pstork1 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

The gallery just shows a filtered and sorted list of what is in the datasource.  For the functionality that you describe I would create a copy of the datasource records that are shown in the gallery, then point the gallery at the collection, not the datasource.  Then you can either delete records from the collection when they click I'm in.  Or maybe create an additional yes/No column that is toggled on that record when they click.  Then filter the gallery based on that column being No.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and Pwr EduCon in Chicago
EduCon Chicago 2022

View solution in original post

3 REPLIES 3
Pstork1
Dual Super User
Dual Super User

The gallery just shows a filtered and sorted list of what is in the datasource.  For the functionality that you describe I would create a copy of the datasource records that are shown in the gallery, then point the gallery at the collection, not the datasource.  Then you can either delete records from the collection when they click I'm in.  Or maybe create an additional yes/No column that is toggled on that record when they click.  Then filter the gallery based on that column being No.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and Pwr EduCon in Chicago
EduCon Chicago 2022

BigTex
Helper I
Helper I

Hello,

I was able to solve it. I fetched the filtered list as a collection on OnStart of the application and then displayed it as a gallery. On OnClick of "Yes, I am still in", I removed the entry from the collection only (Select(Parent);Remove(CollectionName,ThisItem)) but on OnClick of "I am no longer part of this committee" I actually removed the item from the datasource and then ClearCollected the collection again:

 Select(Parent);RemoveIf(SPDataSource,Title=Gallery1.Selected.Title);Refresh(SPDatasource);ClearCollect(CollectionName,Filter(SPDataSource,Lower(Right(Member.Claims,Len(glbUserEmail)))=Lower(glbUserEmail)).Title) 

Pstork1
Dual Super User
Dual Super User

Yes, that's pretty much what I figured it should look like.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and Pwr EduCon in Chicago
EduCon Chicago 2022

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (4,240)