cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
bubs
Level: Powered On

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
Dual Super User
Dual Super User

Re: Remove form from gallery when submitted

Hi @bubs 

 

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
Dual Super User
Dual Super User

Re: Remove form from gallery when submitted

Hi @bubs 

 

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

bubs
Level: Powered On

Re: Remove form from gallery when submitted

@RezaDorrani 

 

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

bubs
Level: Powered On

Re: Remove form from gallery when submitted

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

Dual Super User
Dual Super User

Re: Remove form from gallery when submitted

Hi @bubs 

 

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

bubs
Level: Powered On

Re: Remove form from gallery when submitted

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. 

Dual Super User
Dual Super User

Re: Remove form from gallery when submitted

Hi @bubs 

 

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

bubs
Level: Powered On

Re: Remove form from gallery when submitted

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

Dual Super User
Dual Super User

Re: Remove form from gallery when submitted

Hi @bubs 

 

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,430)