cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PJS-Data-Admin
Helper I
Helper I

How to remove gallery item in popup

Hello All,

 

I am almost done my newest power app, but I just started working on the offline access of the collections. For this app, a user will scan to "check-in" to a location and then scan to "check out" of a location. After first scan, that data goes into a gallery. When the user is ready to checkout, they select a "Check-Out" barcode scan button from that gallery row. "OnScan" it will generate a popup where they confirm the checkout before that data is then sent to a SharePoint list and adding to a "History" gallery. Here is where the issue lies:

 

After that popup loads and is completed (this popup pulls data from that specific row in the gallery), I need that specific row in the gallery deleted. I used the Remove("CollectionName", ThisItem) for the "OnScan" of the barcode scanner, but that no longer works when saving the data. What is the formula and where can I put it to remove that row?

 

Could someone assist? See images for steps:

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @PJS-Data-Admin ,

 

Yes you can do that. 

On click of Checkout button instead of Remove datasource item add

Set(varDelete,ThisItem);

 

Than on click of complete add 

 

Remove(YourDataSourceName,varDelete);

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

View solution in original post

7 REPLIES 7
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @PJS-Data-Admin ,

 

The collection name you mentioned is it a collection or direct datasoruce?

If it is collection please try Patch after the remove code to patch the collection data to the datasoruce or directly remove from the datasoruce.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hello @PG_WorXz10,

 

Thank you for the response - it is a collection. The flow goes from collection to collection & SharePoint list. I will try to patch, do you have any examples of this for this situation?

Hi @PJS-Data-Admin ,

 

After your Remove from collection would you also add below remove code but here mention the direct data source

Remove(DataSourceName,Thisitem);

name. 

 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

@PG_WorXz10 Understood. I know the patch function will work and allow me to delete the gallery item at the same time OnSelect of the "CheckOut" button in my images, but I would have to remove the popup confirmation screen from my app to do so, is there a workaround? Can it delete that specific gallery record on select of the complete button in my popup?

 

PJSDataAdmin_0-1629897571086.png

 

Hi @PJS-Data-Admin ,

 

Yes you can do that. 

On click of Checkout button instead of Remove datasource item add

Set(varDelete,ThisItem);

 

Than on click of complete add 

 

Remove(YourDataSourceName,varDelete);

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

View solution in original post

Hi @PJS-Data-Admin ,

 

I hope your issue is resolved if not I am happy to help to get deeper into this issue.

 

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

@PG_WorXz10 I was able to use a RemoveIf function to solve this, but your method works as well - Here is what worked for me::

RemoveIf(CollectionName, ColumnName =CheckInGallery.Selected.ColumnName)

 

Thank you!!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,996)