I would like to find out how to download selected attachments.
I have used the script below and followed instructions to create a script in Pro and download the attachments to a specific folder. What I would like to do is add an SQL query so I can specify the attachments I want to download.
I set up the script tool to use SQL query and specified the name of the column
However the query has no values.
Below is the script I used from the help docs
import arcpy
from arcpy import da
import os
inTable = arcpy.GetParameterAsText(0)
fileLocation = arcpy.GetParameterAsText(1)
with da.SearchCursor(inTable, ['DATA', 'ATT_NAME', 'ATTACHMENTID']) as cursor:
for item in cursor:
attachment = item[0]
filenum = "ATT" + str(item[2]) + "_"
filename = filenum + str(item[1])
open(fileLocation + os.sep + filename, 'wb').write(attachment.tobytes())
del item
del filenum
del filename
del attachment
and
SQL Expression parameters require a "Dependency" on the parameter you want to filter so it can populate the dialog, set that up and your parameter should work
thanks do you have an example that I could add to the script