Remove attachments in batches from feature service?

927
4
06-23-2021 12:07 PM
SFM_TravisBott
Occasional Contributor II

Is it possible to remove all attachments from a large number of selected features in a feature service all at once, butnotremove everything?

As far as I know the only way I've been able to remove attachments is by toggling them off and then back on again. You get a pop-up warning that they'll all be removed. What if I just wanted to remove attachments, from, say 100 features, rather than all of them? Is this possible?

(of note, I'm not sure how to do this on a feature class in Pro, either. Definition queries and selecting features doesn't seem to stop all attachments getting removed).

0Kudos
4 Replies
DebMcIlwrath
New Contributor III

Check out the "Remove Attachments" tool in Pro

- select the features you want to remove attachments from and export the selection to a table (uncheck maintain attachments in the environments settings when you do this)

- in the remove attachments tool, use your feature class is the input data and the exported table is the match table

0Kudos
SFM_TravisBott
Occasional Contributor II

I'll try that method.

I'm familiar with the remove attachments tool, but it was removing allattachments on my test feature classes/feature services, regardless of selection, definition query, or creating a separate layer.

The workaround of exporting a separate table is funky but I'll give it a go.

0Kudos
SFM_TravisBott
Occasional Contributor II

Following up, after testing:@DebMcIlwrath's method works well for a feature class. It doesnotwork for a feature service (which is what I'm trying to accomplish. I received warnings that for the selected records attachments could not be removed, but then they appeared to be removed anyways).

So if you're attempting to selectively remove batches of attachments on a feature service you would have to use a bit of a workaround, like exporting the subset of features, removing their attachments, and then replacing their old version in the feature service.

0Kudos
MeganEngel
Occasional Contributor

Did you try any other methods to accomplish this and were they successful? I need to perform this workflow on a very large dataset.

Thanks.

0Kudos