# Is there a way to import bulk deletion jobs?

**URL:** https://www.dynamicsuser.net/t/is-there-a-way-to-import-bulk-deletion-jobs/87952
**Category:** Customer Engagement
**Created:** [May 16, 2025, 2:48am UTC](https://www.dynamicsuser.net/t/is-there-a-way-to-import-bulk-deletion-jobs/87952 "2025-05-16T02:48:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Marc\_Rohde](https://sea1.discourse-cdn.com/flex023/user_avatar/www.dynamicsuser.net/marc_rohde/32/9630_2.png) [@Marc\_Rohde](https://www.dynamicsuser.net/u/Marc_Rohde)
#### Post date: [May 16, 2025, 2:48am UTC](https://www.dynamicsuser.net/t/is-there-a-way-to-import-bulk-deletion-jobs/87952/1 "2025-05-16T02:48:11Z")

</div>

When I copy data from prod to a sandbox I usually go through a series of bulk deletions to save space. While I know I could stack a bunch of Power Automate Job I have run into throttling issues.

Is there a good way to import or create these jobs through Power Automate? I think one option I could consider is Power Automate Desktop but would certainly prefer a better approach.

---

<div class="post-metadata">

### Author: ![Alex\_Brown](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@Alex\_Brown](https://www.dynamicsuser.net/u/Alex_Brown)
#### Post date: [June 30, 2025, 11:08am UTC](https://www.dynamicsuser.net/t/is-there-a-way-to-import-bulk-deletion-jobs/87952/2 "2025-06-30T11:08:47Z")

</div>

Hi Marc, I know we’ve created them programmatically using C# previously. Here’s a snippet (it was to set up bulk delete jobs for audit, but you can apply to any entity).  
Feel free to reach out and we can set up a call if you’d like to review in any more detail (no charge, just offering some help).

> QueryExpression queryExpression = new QueryExpression(“audit”);  
> FilterExpression filterExpression = new FilterExpression(LogicalOperator.And);  
> FilterExpression childFilter1 = new FilterExpression(LogicalOperator.Or);  
> FilterExpression childFilter2 = new FilterExpression(LogicalOperator.And);  
> childFilter2.AddCondition(“objecttypecode”, ConditionOperator.Equal, (object) 2);  
> childFilter1.AddCondition(new ConditionExpression(“auditid”, ConditionOperator.In, (ICollection) stringList));  
> filterExpression.AddFilter(childFilter2);  
> filterExpression.AddFilter(childFilter1);  
> queryExpression.Criteria = filterExpression;  
> BulkDeleteRequest request = new BulkDeleteRequest()  
> {  
> QuerySet = new QueryExpression[1]{ queryExpression },  
> JobName = “Bulk Delete of audit records with attribute mask values relating to Specific Entity”,  
> SendEmailNotification = false,  
> ToRecipients = new Guid[0],  
> CCRecipients = new Guid[0],  
> RecurrencePattern = string.Empty,  
> StartDateTime = DateTime.UtcNow  
> };  
> try  
> {  
> Guid jobId = ((BulkDeleteResponse) svc.Execute((OrganizationRequest) request)).JobId;  
> Entity entity = svc.Retrieve(“asyncoperation”, jobId, new ColumnSet(new string[3]  
> {  
> “name”,  
> “statecode”,  
> “statuscode”  
> }));  
> tracingService.Trace(string.Format(“Job Name: {0}”, entity[“name”]));  
> tracingService.Trace(string.Format(“Job Id: {0}”, (object) entity.Id));  
> tracingService.Trace("State: " + entity.FormattedValues[“statecode”]);  
> tracingService.Trace("Status: " + entity.FormattedValues[“statuscode”]);  
> }  
> catch (Exception ex)  
> {  
> tracingService.Trace(ex.Message);  
> }

---

<div class="post-metadata">

### Author: ![Marc\_Rohde](https://sea1.discourse-cdn.com/flex023/user_avatar/www.dynamicsuser.net/marc_rohde/32/9630_2.png) [@Marc\_Rohde](https://www.dynamicsuser.net/u/Marc_Rohde)
#### Post date: [June 30, 2025, 1:40pm UTC](https://www.dynamicsuser.net/t/is-there-a-way-to-import-bulk-deletion-jobs/87952/3 "2025-06-30T13:40:27Z")

</div>

> [@Marc\_Rohde](#):
>
> a good way to import or create these jobs through Power Automate? I think one option I could con

I figured out a way to handle ths using the connector to Perform Unbound Actions. The action name is bulk delete.

I have a control table in Dataverse that list the table name, days to keep and then iterate thought the table I want to perform the build delete on.

We keep this flow in our default environment with the data so it is easy to select the target environment.

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dugusers/original/2X/6/61e345c575eb3c91cd10f200003ee4def3ea3113.png)
