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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Bulk delete all attach...
Power Apps
Answered

Bulk delete all attachments across all entities

(0) ShareShare
ReportReport
Posted on by 142

Other than Notes entities with a filter of isDocument = True, how to schedule a bulk deletion of all attachment entities?

 

even after running the jobs, attachments are available in different entities.

Curently executing the below SQL Queries with XRMToolBox SQL4CDS utility. 

 

  • Delete from attachment
  • Delete from fileattachment
  • delete from activitymimeattachment
  • delete from activityfileattachment
  • Delete from elasticfileattachment
  • Delete from msdyn_aibfileattacheddata
  • Delete from msdyn_kbattachment
I have the same question (0)
  • Verified answer
    ChrisPiasecki Profile Picture
    6,424 Most Valuable Professional on at

    Hi @Mustaque_Ehiya,

     

    Do you have an example of which table/column you're still seeing attachments?

     

    Those tables you listed are mainly for email for email attachments and then a couple of D365 specific ones such as Knowledge Article.

     

    If you're using a custom image or file column, then you'll need to delete from the specific table column that is file/image enabled.

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

  • Mustaque_Ehiya Profile Picture
    142 on at

    Running the below sql query scheduled bulk delete jobs 

    Mustaque_Ehiya_0-1694675720283.png

     

    Mustaque_Ehiya_1-1694675736855.png

     

    I don't see this activity "file attachment" as a configurable entity if I had to schedule directly in the bulk delete page.  Do we have an option to configure the bulk delete of all attachments across entities in CRM itself?

    Mustaque_Ehiya_2-1694675763530.png

     

  • ChrisPiasecki Profile Picture
    6,424 Most Valuable Professional on at

    Hi @Mustaque_Ehiya,

     

    Some tables like that one won't be available via Advanced Find or through the UI and need to be interacted with programmatically. Some of the XrmToolBox plugins like you've discovered do this and provide a means to do so. 

     

    You could use Power Automate to do the bulk deletion yourself using the BulkDelete action. Here is a guide on how to do so.

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 633

#2
11manish Profile Picture

11manish 588

#3
Valantis Profile Picture

Valantis 457

Last 30 days Overall leaderboard