cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sahara22
Helper V
Helper V

Delete item from sharepoint list when another list with the same value is created

Hello,

 

I have two sharepoint lists .

 

I would like when a new item is created in one list it deletes and item another list based on the same item in both list.

 

for example, if a equipment number is added in "List A" and its the same in "list B". i would like the whole item row in "List B" to be deleted.

 

I tried the following bellow but nothing happens: 

 

902977D1-482B-4EEA-A7DB-0900C3F11BDA.jpeg

 

Any help would be great! (please note, i made the website (www.www) intentionally for privacy) 

1 ACCEPTED SOLUTION

Accepted Solutions
ScottShearer
Super User
Super User

@Sahara22 

You'll want to add a Filter query to your Get items action - you'll find this in advanced options.  If the column that the two lists have in common is called Equipment, the query should look something like this:

Equipment eq 'reference to equipment in List A from dynamic properties'

Note the following:

The column names cannot have spaces - use the SharePoint internal name

The item selected from Dynamic properties must be enclosed in single quotes

Filter queries are case sensitive.

 

If you use this filter query, you should get either 1 or no items back.

Remove your condition and just have the Delete item inside of the loop.

Here is a reference for more info on filter queries

 

Let me know if you need more help.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

2 REPLIES 2
ScottShearer
Super User
Super User

@Sahara22 

You'll want to add a Filter query to your Get items action - you'll find this in advanced options.  If the column that the two lists have in common is called Equipment, the query should look something like this:

Equipment eq 'reference to equipment in List A from dynamic properties'

Note the following:

The column names cannot have spaces - use the SharePoint internal name

The item selected from Dynamic properties must be enclosed in single quotes

Filter queries are case sensitive.

 

If you use this filter query, you should get either 1 or no items back.

Remove your condition and just have the Delete item inside of the loop.

Here is a reference for more info on filter queries

 

Let me know if you need more help.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Sahara22
Helper V
Helper V

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 (1,198)