Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Deleting a row in Dataverse table fails

(0) ShareShare
ReportReport
Posted on by

Hi all 

I have created a flow that should delete a row in Dataverse when comparing to an excel sheet based on a condition. 


Error:  Action 'Delete_a_row' failed, says "bad request" & "ActionFailed. An action failed. No dependent actions succeeded."

Thomas_R_H_1-1696411132565.png

 



I am not sure if its my logic or my choice of dynamic content in the flow that is the problem and I hope you are able to help me out: 

This is how the flow looks: 

Thomas_R_H_0-1696410707652.png

Logic is to loop through dataverse table and nested loop in the excel sheet, IF ID (dateverse) != ID (excel), If yes, then delete row in dataverse. 
So i want to see in there exist an ID in dataverse that do not exist in excel, then it should delete that row in dataverse

Br   

  • Thomas_R_H Profile Picture
    on at
    Re: Deleting a row in Dataverse table fails

    Hi @rzaneti 

     

    This is a very good explanation and I have learned a lot!
    Very good information you came with and you also saved me computational time with the query and no nested loop, really nice! 

    Enjoy your day 🙂 
    Br 

  • Verified answer
    rzaneti Profile Picture
    4,096 Super User 2025 Season 1 on at
    Re: Deleting a row in Dataverse table fails

    Hi @Thomas_R_H ,

     

    'Delete a row' action issue

    About your 'Delete row' action, you are passing the record 'ID' as input, but you should pass the record 'GUID' instead (see the tooltip highlighted in yellow):

    rzaneti_0-1696454288329.png

     

    I know that it sounds confusing and Power Automate is tricky with these Dataverse actions: while the ID column is a kind of "user friendly" unique identification, the GUID is the ID for the system purposes, used in the integrations between Dataverse and Power Automate. The good news is that you can easily identify it, by just typing "unique" in your 'dynamic content' search bar (the GUID property will be described as 'unique identifier of the [table]', as highlighted in yellow below): 

    rzaneti_1-1696454433912.png

     

    Also, in most part of the times the GUID property matches to the table's name without plural (in the example above, we are working with the 'Accounts' table and the GUID property is called 'Account'). 

     

    Logic to not remove all table records

    About the logic to make sure that your flow will delete from Dataverse only the records that are not present in Excel table, I recommend you to take an approach like this:

    rzaneti_7-1696455932564.png

     

     

    Let's assume that you have this Excel table:

    rzaneti_2-1696455166066.png

     

    And this Dataverse table:

    rzaneti_3-1696455190102.png

    They are pretty much the same, but the Dataverse table contains an extra record that cannot be found in Excel (ID 6). 

     

    In a first moment, your flow will follow the current design: you have a 'List rows' from Dataverse connector and use an 'Apply to each' loop on its output. Inside each loop iteration, you have a 'List rows present in a table' action from Excel connector, and in this action you will include something different. Instead of return all Excel records, add a 'Filter query' to return only the rows which 'id' matches to the id of the current loop iteration (highlighted in yellow):

    rzaneti_4-1696455509363.png

    Filter query: id eq '[dynamic content for DV ID]'

    Note: do not forget to surround your dynamic content with single quotes

    Note2: make sure to select the ID dynamic content from Dataverse, and not from Excel

     

    Then add a 'Condition' to test if the Excel action returned an empty array. To achieve it, set the expression in the left side of the statement (highlighted in yellow) and 0 in its left side (highlighted in green):

    rzaneti_5-1696455769002.png

    Expression: length([dynamic content of your Excel action value property])

     

    Inside the 'If yes' block, add the 'Delete row' action, setting the GUID of your Dataverse record as 'Row ID'. Hilariously, in my example, the GUID property name (highlighted in yellow) does not match to the actual table name 😅

    rzaneti_6-1696455828595.png

     

     

    Output

    The flow ran successfully:

    rzaneti_8-1696455958592.png

     

    And my Dataverse table doesn't have the record with ID 6 anymore 🙂

    rzaneti_9-1696456001069.png

     

    Let me know if it works for you or if you need any additional help!

     

    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

    http://digitalmill.net/ 

  • Thomas_R_H Profile Picture
    on at
    Re: Deleting a row in Dataverse table fails

    Hi, 

    Thanks for the reply! 

    Thomas_R_H_0-1696423530708.png

    So as you mention your self, the logic is to delete the row with ID 5, since it is not in the excel sheet. 
    How would you then create the flow to only delete the rows that do not exist and not just all like my flow? 

    Br

  • rzaneti Profile Picture
    4,096 Super User 2025 Season 1 on at
    Re: Deleting a row in Dataverse table fails

    Hi @Thomas_R_H ,

     

    Could you please share an image about how are you populating the fields from 'Delete row' action? It is possible that you have an error in your dynamic content input. 

     

    Also, unless you are applying a filter to your 'List rows present in a table', in a first analysis, it looks like that your current flow design won't be delivering exactly what you expect.

     

    Let's imagine that you have the following ids in Excel (1, 2, 3, 4) and the following in Dataverse (1, 2, 3, 4, 5). In this scenario, based on your description, the flow should delete only the id 5 from Dataverse, however the current flow design must delete all of them. This is why:

     

    As the flow will be looping all Excel records and, for each of these iterations, looping all Dataverse records, this is the expected behavior:

    • Iterate Excel id 1
      • test if Dataverse id 1 is not equal to Excel id 1 (false)
        • Do nothing
      • test if Dataverse id 2 is not equal to Excel id 1 (true)
        • Delete Dataverse id 2
      • test if Dataverse id 3 is not equal to Excel id 1 (true)
        • Delete Dataverse id 3
      • test if Dataverse id 4 is not equal to Excel id 1 (true)
        • Delete Dataverse id 4
      • test if Dataverse id 5 is not equal to Excel id 1 (true)
        • Delete Dataverse id 5
    • Iterate Excel id 2
      • test if Dataverse id 1 is not equal to Excel id 2 (false)
        • Delete Dataverse id 1

     

    In summary, it will delete all Dataverse records.

     

    Please confirm if these thoughts make sense and, if yes, I can also help you to fix the flow design 🙂

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1