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."
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:
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
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
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):
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):
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:
Let's assume that you have this Excel table:
And this Dataverse table:
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):
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):
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 😅
Output
The flow ran successfully:
And my Dataverse table doesn't have the record with ID 6 anymore 🙂
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.
Hi,
Thanks for the reply!
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
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:
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 🙂
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1