Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

BulkDelete action in Dataverse

(0) ShareShare
ReportReport
Posted on by 26

Hello!

We have an annual data clean-up wherein we need to delete Contact records that doesn't have any Case associated to it. I couldn't find a reference of query set syntax with related entity used as a filter condition. Would you please help translate below FetchXML query to a QuerySet that is used in PowerAutomate? Thank you!


pastedimage1669302081553v3.png

pastedimage1669302116664v4.png
  • Susie Z Profile Picture
    Susie Z 14 on at
    BulkDelete action in Dataverse
    Hi Jean,
     
    A bit late for a response, I hope your query was solved!
     
    For reference, the syntax below works for related entities in the Power Automate unbound action. 
     
    [
       {
          "EntityName":"<sourceentity_schemaname>",
          "LinkEntities":[
             {
                "LinkFromEntityName":"<sourceentity_schemaname>",
                "LinkFromAttributeName":"<sourceentity_column_schemaname>",
                "LinkToEntityName":"<relatedentity_schemaname>",
                "LinkToAttributeName":"<relatedentity_column_schemaname>",
                "JoinOperator":"Inner",
                "LinkCriteria":{
                   "Conditions":[
                      {
                         "AttributeName":"<column_schemaname>",
                         "Operator":"Equal",
                         "Values":[
                            {
                               "Value":"<value>",
                               "Type":"System.String"
                            }
                         ]
                      }
                   ]
                }
             }
          ]
       }
    ]
     
    References:
  • Jean M. Profile Picture
    Jean M. 26 on at
    RE: BulkDelete action in Dataverse

    Hello Steve Zhao2 , thank you for your help. I've checked the link provided but it doesn't contain syntax for link-entity. Would you know any other reference that we could use? Also, I tried to pattern the syntax for link-entity condition but it doesn't work.

    pastedimage1669961604334v2.png

  • Albion Ferracaku Profile Picture
    Albion Ferracaku 20 on at
    RE: BulkDelete action in Dataverse

    Hello,

    According to your query, field "..caller" of "contact" should be null. So selecting field "..caller" in "Fields" section and choosing "Does Not Contain Data" should be enough.

    Screenshot_5F00_10.pngScreenshot_5F00_11.png_2D00_640x480.png

    (in my case: "Account" is a lookup field that points to Account entity)

  • Steve Zhao2 Profile Picture
    Steve Zhao2 on at
    RE: BulkDelete action in Dataverse

    Hi Jean M,

    There is a tool named FetchXML builder which can convert fetchxml to Query Expression in the Xrm Toolbox.

    However, it isn't the format of QuerySet in the Bulk Delete action and you need manually build it.

    pastedimage1669360360166v1.png

    About the format, you can refer to this link:

    Solved: Dataverse - Perform an unbound action - Bulk Delet... - Power Platform Community (microsoft.com)

  • Bipin D365 Profile Picture
    Bipin D365 28,959 Super User 2024 Season 1 on at
    RE: BulkDelete action in Dataverse

    Hi,

    Create rollup field on consumer entity of type whole number to store the count of case file records.

    learn.microsoft.com/.../define-rollup-fields

    Now use this field in your filter criteria

    if yourrollupfield value ==0 Delete

  • Jean M. Profile Picture
    Jean M. 26 on at
    RE: BulkDelete action in Dataverse

    Hello Bipin Kumar, thank you for your response. Unfortunately, does not contain condition (for related entity) is not available as operator in Bulk delete. Would you know if there is a workaround for this one? Our goal is to delete consumer (contact) records that doesn't have any case(file) associated to it.
    pastedimage1669329772344v2.png

    Here's the condition used in the view.
    pastedimage1669329439064v1.png

  • Bipin D365 Profile Picture
    Bipin D365 28,959 Super User 2024 Season 1 on at
    RE: BulkDelete action in Dataverse

    Hi,

    Can you not setup oob bulk delete jobs to cleanup your records?

    learn.microsoft.com/.../delete-bulk-records

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,684 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,414 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans