cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Remove form from gallery when submitted

Hello

 

I am currently working on an app with offline capabilities. I have two galleries, one holds the forms that were submitted to the data source SP and the other holds the forms that were saved offline in a collection. I use a patch function to send each individual form to the data source and when I go back to the home page, the form is in both gallerys.

 

I really want to know how do I remove the Form from the collection when it is successfully submitted to SP? is there something I need to put in the patch? like a clear or do i need to add a condition to the gallery. Please let me know. Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hi @Anonymous 

 

what is unqiue with respect to the value being added to collection and sharepoint

 

If for example it is the ID value

 

then when you patch to sharepoint

do removeif(collection, ID = theidpatched)

or Title = titlevalue patched

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

View solution in original post

8 REPLIES 8
Highlighted
Dual Super User II
Dual Super User II

Hi @Anonymous 

 

after you successfully pacth the data you need to remove the item from the gallery

Use RemoveIf and define the condition to remove the item posted to SharePoint from the gallery

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted
Anonymous
Not applicable

@RezaDorrani 

 

Where would you put the removeif inside the gallery? would it be in items?

Highlighted
Anonymous
Not applicable

it would be removeif(Data souce, ???) not sure what the condition would be 

Highlighted

Hi @Anonymous 

 

Can you post a screnshot of your App where you are patching data to collection and SharePoint

Highlighted
Anonymous
Not applicable

I removed some of the data so it could fit in one image. I have a seperate button on the home screen that patches the selected item in the gallery to SP. It is just a patch with no other code. 

Highlighted

Hi @Anonymous 

 

what is unqiue with respect to the value being added to collection and sharepoint

 

If for example it is the ID value

 

then when you patch to sharepoint

do removeif(collection, ID = theidpatched)

or Title = titlevalue patched

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

View solution in original post

Highlighted
Anonymous
Not applicable

I used the title and it seemed to work thanks. However for some reason when i create a form offline it creates two in the collection. Could this be because i do the +1 after my collection? " Collect(MySPCollection,{id: Max(MySPCollection,id)+1 " It creates two forms and when I select one to patch it patches and is removed, however the other form wont transition even though it patches

Highlighted

Hi @Anonymous 

 

No looks like you are only setting the id attribute by adding 1 to it

must be some other reason or may be you are calling collect twice

check your code base again

 

Glad to know that you were able to remove the item from collection though using RemoveIf

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,966)