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

Remove Items from more than one SharePoint list

Hi,

 

I want to remove items from two SharePoint lists when a Delete icon is selected. I am able to do this for one SharePoint list using this formula: Remove('PO Log', Gallery1.Selected);  If (IsEmpty(Errors('PO Log', Gallery1.Selected))

 

But also want to remove multiple items in another list (POOrderDetails).  The column they both have in common is: PONumber. Does anyone know how i can adjust the above formula to do this? I have looked at the Remove function info page for PowerApps but am none the wiser as the examples used are only for one list.

 

Any help would be much appreciated

 

thanks

 

Mike

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
h-nagao
Level 10

Re: Remove Items from more than one SharePoint list

Hi mike,
Your app already connected to ‘POOrderDetails’ ?
If so, could you try to add following formula after Remove(‘PO Log’...) ?

RemoveIf(‘POOrderDetails’,PONumber=Gallery1.Selected.PONumber)

RemoveIf function will remove record(s) from data source if satisfying condition.
In this case, remove records from POOrderDetail when their records have same PONumber as selected in Gallery.

Thanks, Hiro

View solution in original post

4 REPLIES 4
h-nagao
Level 10

Re: Remove Items from more than one SharePoint list

Hi mike,
Your app already connected to ‘POOrderDetails’ ?
If so, could you try to add following formula after Remove(‘PO Log’...) ?

RemoveIf(‘POOrderDetails’,PONumber=Gallery1.Selected.PONumber)

RemoveIf function will remove record(s) from data source if satisfying condition.
In this case, remove records from POOrderDetail when their records have same PONumber as selected in Gallery.

Thanks, Hiro

View solution in original post

Community Support Team
Community Support Team

Re: Remove Items from more than one SharePoint list

Hi @mikiepat,

Do you also want to remove multiple items whose PONumber column value is equal to the PONumber value of the selected item in your Gallery1?

I have made a test on my side, please take a try with the following workaround:

Set the OnSelect property of the "Remove"  button to following:

RemoveIf('POOrderDetails', PONumber = Gallery1.Selected.PONumber); /* <-- Add formula here. Please type this formula before the Remove('PO Log', Gallery1.Selected)*/
Remove('PO Log', Gallery1.Selected);
If(
IsEmpty(Errors('PO Log', Gallery1.Selected)),
...
)

Or

Remove('POOrderDetails', Filter('POOrderDetails', PONumber = Gallery1.Selected.PONumber)); /* <-- Add formula here. Please type this formula before the Remove('PO Log', Gallery1.Selected)*/
Remove('PO Log', Gallery1.Selected);
If(
IsEmpty(Errors('PO Log', Gallery1.Selected)),
...
)

More details about Remove function and RemoveIf function, please check the following article:

Remove function, RemoveIf function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mikiepat
Level: Powered On

Re: Remove Items from more than one SharePoint list

thanks h-nagao that worked a treat!

 

appreciate your prompt resonse

 

Mike

mikiepat
Level: Powered On

Re: Remove Items from more than one SharePoint list

Hi Kris,

 

Yes your formula is smiliar to the one i applied, thanks for your response,

 

kind regards,

 

Mike

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Kudoed Authors
Users Online
Currently online: 292 members 5,664 guests
Please welcome our newest community members: