web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

BulkDelete action in Dataverse

(0) ShareShare
ReportReport
Posted on by 48

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
I have the same question (0)
  • Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

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

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

  • Jean M. Profile Picture
    48 on at

    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
    28,983 Moderator on at

    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

  • Steve Zhao2 Profile Picture
    on at

    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)

  • Albion Ferracaku Profile Picture
    20 on at

    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)

  • Jean M. Profile Picture
    48 on at

    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

  • Susie Z Profile Picture
    14 on at
    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:

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 62 Most Valuable Professional

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Pallavi Phade Profile Picture

Pallavi Phade 49

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans