Select to view content in your preferred language

Issues with script tool for exporting attachments from table

160
0
3 weeks ago
Labels (2)
SBrandenburg
New Contributor III

Hi All,

Our company relies heavily on Field Maps for data collection, including photo documentation while in the field. I'm not super well-versed in Python, but I found a script that will pull the photo attachments from the field data via the _ATTACH table in the FGDB downloaded from AGOL: https://support.esri.com/en-us/knowledge-base/how-to-batch-export-attachments-from-a-feature-class-i... 

It works great as-is; however, the naming system is too vague for purposes of photo organization when the field crews take hundreds of photos. The photos are collected as attachments to point and line features in AGOL, and I'd like to use the data that the crews enter into the point/line fields to name the exported photos (in our case, the "Notes" field). I joined the _ATTACH table to the feature class (see join example included) so that all of the fields from the feature class are available in the _ATTACH table. I had (perhaps incorrectly) assumed that I could then reference the joined fields in my script tool to name the exported photos, but I always get an error saying that the field that I reference is unable to be found. I've attached my script with the tweaks I made, as well as a screenshot of the fields I'm referencing. 

 

SBrandenburg_0-1717706535135.png

 

SBrandenburg_2-1717706759518.png

SBrandenburg_3-1717706823168.png

SBrandenburg_1-1717706691704.png

As I said, I only dabble in Python, so if there is an obvious error that someone could point out, that would be great. I've also tried adding fields to the _ATTACH table with the hopes of adding the associated notes, but it seems that modifying the fields of the table is not allowed.  If it isn't possible for the script to act upon joined fields, does anyone know of a way to modify the fields that are created in the _ATTACH table when you allow photos to be collected on a new layer in AGOL? I sifted through AGOL a bit, but didn't have any luck.

Thanks!!

 

0 Kudos
0 Replies