cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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
RezaDorrani
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

Anonymous
Not applicable

@RezaDorrani 

 

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

Anonymous
Not applicable

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

Hi @Anonymous 

 

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

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. 

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

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

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (83,557)