web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Delete item from two s...
Power Automate
Unanswered

Delete item from two separate lists based on checkbox

(0) ShareShare
ReportReport
Posted on by 100

Hello,

 

I am trying to make a flow that does the following:

In list 1, when there is a change, flow checks for a YES on the "delete?" column.

Flow then gets items from list 2, deletes them, then deletes the item in list 1.

 

I am *almost* there.  I am just having difficulty deleting the item from list 2.  I am attaching my current flow, which runs, but ends up not only deleting the item that was originally marked for deletion in list 1, but a ton of others as well.  Can someone help me figure out how to ONLY delete the items checked YES in list 1?  I figure the issue has something to do with the "apply to each" but I don't know how to make it work without that.

 

Thanks!

tdwils_0-1646169738146.png

tdwils_1-1646169785517.png

 

 

Categories:
I have the same question (0)
  • fchopo Profile Picture
    8,003 Moderator on at

    Hi @tdwils 

    Is there a way you can identify items in both lists? For instance, do they have the same value in the "Title" column? If that's the case, you could do something like this:

    managers.png

     

    1) Get the item in list 2, using the filter expression:

    Title eq 'triggerOutputs()?['body/Title']'

    2) Although you will only find one single element, Power Automate doesn't know that, and you have to select the first row of the output, using a compose action with the following expression (you will get the id of the element found):

    first(outputs('Get_items')?['body/value'])?['id']

    3) Delete the item using the id previously found.

     

    Hope it helps!

    Ferran

  • tdwils Profile Picture
    100 on at

    Hi @fchopo -

     

    I'm still unable to get this to work.  I had to change my checkbox to a text entry (as selecting or deselecting a checkbox didn't seem to trigger the flow but editing text does).  I added everything that you mentioned and it keeps getting stuck on the Delete Items action.  Here's what it tells me:

    The 'inputs.parameters' of workflow operation 'Delete_item' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'id' is required to be of type 'Integer/int64'. The runtime value '"first(outputs('Get_items')?['body/value'])?['id']"' to be converted doesn't have the expected format 'Integer/int64'.

    When I tried to fill in the id with the dynamic content version, it put "delete item" into an apply to each thing again...

    Here is an updated picture of the flow...

    tdwils_0-1646241343996.png

    tdwils_1-1646241408468.png

     

    Thanks!

     

  • fchopo Profile Picture
    8,003 Moderator on at

    Hi @tdwils 

    Please, add the expression as an expression, and not as "Dynamic content":

    expression.png

     

    Ferran

  • tdwils Profile Picture
    100 on at

    @fchopo 

     

    I fixed the expression and now it is giving me a different error...

    tdwils_1-1646257497843.png

     

    tdwils_0-1646257458051.png

     

  • tdwils Profile Picture
    100 on at

    @fchopo- hello - did you have any suggestions for the error I am running into?  Thanks for your time!

  • tdwils Profile Picture
    100 on at

    Bumping for visibility.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard