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 a row in SQL Se...
Power Automate
Unanswered

Delete a row in SQL Server when Corresponding row in Dynamics 365 has been Deleted

(0) ShareShare
ReportReport
Posted on by 2

I've created a flow that has a Dynamics 365 trigger for When a record is deleted, the Action off the back of this is SQL Server Delete row V2. 

 

When a row is then deleted from the contact entity in Dynamics 365 it attempts to delete the corresponding row in SQL. The error I get back is Resource not found, status code 404.

 

I understand the Row ID parameter on the SQL delete needs to be a primary key in the SQL table, which it is. The data type is set to a unique identifier too. With the Row ID set to Dynamic content and the ContactID field selected. I know there are two different contact id fields but I'm definitely selecting the same field as I'm using for an Insert using dynamics trigger and SQL Insert. 

 

All I'm using is the standard GUI on the flow site so I dont see how I can be going wrong, however I cant seem to find a way around the error, any suggestions more than welcome

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @ajludlow 

     

    The when an item is deleted trigger, returns only the GUID of that particular record that is deleted. So, this record should exist in the SQL table too inorder to retrieve and identify the row that needs to be deleted. You can probably add a row to the SQL table named as rowidind365 and whenever a record is created in that entity in D365, setup a flow to copy the GUID of that record and update the row in SQL. That way, when the item gets deleted, it will be better to compare the GUID row and delete the corresponding item (makes sense?)

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • ajludlow Profile Picture
    2 on at

    Hi @yashag2255 

     

    Thanks for the reply, for the Delete trigger I'm already using the contactid field from D365, which is the unique GUID for the record. I'm also using this same field for another flow that creates an entry in the same SQL table, with the field named as ContactID, this field is also set as the primary key on the SQL table. With that in mind it should already be comparing like for like on the same field?

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 463 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 427 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard