cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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
Highlighted
Impactful Individual
Impactful Individual

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
Highlighted
Impactful Individual
Impactful Individual

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

Highlighted
Community Support
Community Support

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.
Highlighted
Helper I
Helper I

Re: Remove Items from more than one SharePoint list

thanks h-nagao that worked a treat!

 

appreciate your prompt resonse

 

Mike

Highlighted
Helper I
Helper I

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (10,962)