I have a gallery that I added a 'delete' icon to.
In the OnSelect property, I added code that I expected to delete "ThisItem" from a PARENT list, and also attempts to remove the related items in a CHILD list.
The Child list has a column called 'Ref ID' that identifies and links its items to their respective Parent item in the main list.
** The code below deletes the Parent item from its list as expected, but it isn't removing the items from the Child list.
RemoveIf(ChildList, 'Ref ID' = ThisItem.ID);
Remove(ParentList, ThisItem)
Any assistance is greatly appreciated.
Thanks for the reply. I figured this out yesterday - I needed to convert ThisItem.ID to text and it worked perfectly.
Also - I wasn't using a lookup column. Not sure where that came from. Again - I appreciate you engaging.
Hi @rkirk2k ,
You just have them the wrong way around
RemoveIf(
ChildList,
'Ref ID' = ThisItem.ID
);
RemoveIf(
ParentList,
ID = ThisItem.ID
)
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.
MVP (Business Applications) Visit my blog Practical Power Apps
Hi @rkirk2k are the lists your are refering to SharePoint lists?
If so, this can be done on List / data source level: (1) go to the LookUp column's settings, (2) more options and use the settings below:
If you want to only use the button, try this adjustment:
RemoveIf(ChildList, 'Ref ID'.ID = ThisItem.ID);
If this solves your question, would you be so kind as to accept it as a solution.
Thanks!