Hi, I'm having an issue with a delete icon in each Gallery item. The code is as below, and for some reason if I don't have the SaveData() code it won't delete the item (sometimes it'll only successfully delete the top item). But if I only have the remove() function it'll delete as it should. I've also tried to call a Timer outside the Gallery to use the SaveData() function but if that code's in there it'll give me the same result as if I had the SaveData() back in. But I know the SaveData() works, because if you deleted the item, the "Back" and "Proceed" buttons have the SaveData() functions in them and if you deleted and hit one of those buttons it would work. I'm wanting the SaveData() in the delete icon, as the photos are saved until they're dealt with or deleted. (also attached is an image of what the Gallery looks like)
Many thanks!
Delete Icon Code:
If(
ThisItem.IsSelected,
Remove(
PhotoCollection,
ThisItem
);
SaveData(
PhotoCollection,
"tempCameraStorage"
)
);
Solved! Go to Solution.
Hi @Hench ,
I can't get your point. What do you want to achieve?
The formula you post doesn't make any sense, 'ThisItem.IsSelected' always returns true when the delete icon is selected, so only remove function can be triggered.
In addition, there is also a potential mistake. Since you are trying to remove items from collection, the entire record must match. Reference from Remove function . However, What 'ThisItem' returns doesn't match the entire record, which also contains some control information within the gallery.
The workaround is to use LookUp function to retrieve the entire record from collection through Unique identifier field.
Remove(PhotoCollection, LookUp(PhotoCollection, GUIDField=ThisItem.GUIDField))
Sik
Hi @Hench ,
I can't get your point. What do you want to achieve?
The formula you post doesn't make any sense, 'ThisItem.IsSelected' always returns true when the delete icon is selected, so only remove function can be triggered.
In addition, there is also a potential mistake. Since you are trying to remove items from collection, the entire record must match. Reference from Remove function . However, What 'ThisItem' returns doesn't match the entire record, which also contains some control information within the gallery.
The workaround is to use LookUp function to retrieve the entire record from collection through Unique identifier field.
Remove(PhotoCollection, LookUp(PhotoCollection, GUIDField=ThisItem.GUIDField))
Sik
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
212 | |
196 | |
83 | |
59 | |
38 |