Select to view content in your preferred language

Write Attachments to AGOL Feature Service

503
4
10-16-2024 07:34 AM
BrianGiroux
Emerging Contributor

I am wondering if anyone has had success writing attachments to an existing feature service hosted on ArcGIS Online using the Data Interop extension. I've been trying to get a simplified workflow up and running (it acts identical to an append tool) but have been unable to get attachments written to a feature service.

For reference, I am running FME Workbench 2024.0.1.0 and ArcGIS Pro 3.1.1. The workspace is set up as follows:

- The reader and writer are referencing feature services hosted on ArcGIS Online.
- "Ending_Locations_A_V2", which is the Reader, has 10 features, 2 of which have attachments.
- "Ending_Lovations_B_V2" has the exact same data schema and starts out empty, attachments are enabled.

BrianGiroux_0-1729088049751.png

I've been able to confirm the reading of the attachments:

BrianGiroux_1-1729088311495.png

This runs with no errors and only warns about OBJECTID and GLOBALID being read-only, which should not be a problem.

Any help is appreciated!

-Brian

 

4 Replies
ChristopherCounsell
MVP Regular Contributor

FME Workbench doesn't support directly writing attachments to ArcGIS Online, so I wouldn't expect the Data Interoperability extension to do this either. Happy to be proven incorrect on this.

https://community.safe.com/data-7/how-to-write-attachments-to-arcgis-online-19577

You can:

  • Make HTTP requests within FME / Data interoperability, to attach the photos using objectids and urls and local files.
  • Use ArcGIS Python API and the AttachmentManager

https://developers.arcgis.com/python/latest/api-reference/arcgis.features.managers.html

I'm more comfortable with the python side but others I know have a lot of success with the HTTP request method.

BrianGiroux
Emerging Contributor

Hi Christopher,

Thanks for confirming my suspicion -- I'll have to look into the alternatives.

-Brian 

RenatoSalvaleon3
Esri Contributor

My apologies for this delayed reply.  Data Interoperability does support writing attachments in AGOL (or Enterpise) primarily by using AGOL's REST API. This was my presentation at the last UC - UC24 proceeding to Intro to Data Interop technical session

 

Here's a guide on what to use in the ESRI stack when working with attachments.

Attachments in feature layers are blobs stored in the data store.

  • HFL attachments have simple 1:M relationship in AGOL
  • GDB or FS by reference use relationship class allowing 1:1 up to M:N.

Patterns of Use for reading/writing/moving attachments are the following:

For simple use cases, use core product tools (Python, GP tool)

  • Attachments collected with ESRI Fields Apps

For complex workflows like below:

  • Move attachments from non-ESRI to ESRI format
  • Manage attachments, eg change detection 
  • Store as hyperlink, database blob or file on disk
  • Reports

Leverage the REST API and for tools use Data Interop of no-code/low code solution or Python or Notebook for coded solutions.

For the following workflows:

  • Backup or Archive – use Replica or Download as FGDB (in the case of AGOL/Enterprise feature services with attachments) 

Non traditional attachment questions can be addressed using Arcade as described in this Blog. 

Please send me a note rsalvaleon@esri.com, if you want to pursue further a Data Interop solution. There is a clear pattern when working with attachments and each pattern would have some slightly different approach.

RenatoSalvaleon3
Esri Contributor

@BrianGiroux I am glad we got this figured out with your AGOL to Enterprise attachment backup workflow.

Let me know if I can be of further assistance as you address the next step in your change detection workflow.

0 Kudos