cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jose_farinha
Frequent Visitor

Get the id of the deleted row

I'm using a trigger for when a dataverse record is deleted. Will I be able to get deleted record's id downstream the flow? Although I'm able to reference all the fields of the tablet in question, these fields seem to be empty. Is there a linda of an old/deleted variable as in SQL Server triggers?

 

Thanks for your attention.

2 ACCEPTED SOLUTIONS

Accepted Solutions
abm
Super User
Super User

Hi @jose_farinha 

 

Please see below where you can capture the deleted records id. Here below in my example I am using Accounts entity record. 

image.png

 

Note sure about you meant by "Although I'm able to reference all the fields of the tablet in question, these fields seem to be empty. Is there a linda of an old/deleted variable as in SQL Server triggers?"



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

Mira_Ghaly
Dual Super User
Dual Super User

@jose_farinha 

You will be able to get the id but you will not be able to get any reference to the fields because power automate works as asynchronous which means it will be run on post operation.

 

The other alternative you have here is to write a plugin in pre-operation so that you can capture the references from the deleted record.

https://docs.microsoft.com/en-us/powerapps/developer/data-platform/tutorial-write-plug-in?WT.mc_id=D...

https://docs.microsoft.com/en-us/powerapps/developer/data-platform/plug-ins?WT.mc_id=DX-MVP-5004221

 

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

View solution in original post

3 REPLIES 3
abm
Super User
Super User

Hi @jose_farinha 

 

Please see below where you can capture the deleted records id. Here below in my example I am using Accounts entity record. 

image.png

 

Note sure about you meant by "Although I'm able to reference all the fields of the tablet in question, these fields seem to be empty. Is there a linda of an old/deleted variable as in SQL Server triggers?"



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
Mira_Ghaly
Dual Super User
Dual Super User

@jose_farinha 

You will be able to get the id but you will not be able to get any reference to the fields because power automate works as asynchronous which means it will be run on post operation.

 

The other alternative you have here is to write a plugin in pre-operation so that you can capture the references from the deleted record.

https://docs.microsoft.com/en-us/powerapps/developer/data-platform/tutorial-write-plug-in?WT.mc_id=D...

https://docs.microsoft.com/en-us/powerapps/developer/data-platform/plug-ins?WT.mc_id=DX-MVP-5004221

 

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here
abm
Super User
Super User

Hi @jose_farinha 

 

ok so I kind of know what you meant by. You need to retrieve the deleted record details. Like @Mira_Ghaly  mentioned you won't be able to do this Power Automate. You could do the following steps to achieve this in Power Automate without writing custom code.

 

1. Remove the delete security role from all users for that specific entity.

2. Create a new security role for delete.

3. Assign the above security role to integration user or the Power Automate connector account who can delete the record.

4. Add a new field called "Marked for Deletion" Yes/No.

5. Once the users set Marked for deletion then trigger the flow to read all the details before deletion.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (2,361)