Question

Trying to use the UpdateDetector to download new Attachments in AGOL

  • 15 August 2019
  • 2 replies
  • 1 view

Badge

Hi all,

I am trying to find a solution that will allow me to query a record in AGOL and compare the attachment globalID to the local attachment globalID. Ideally, I want to either keep the existing photo in our system as it is the same as online or download a replaced photo or download only any added images to the record.

Using the updatedetector is the obvious way. I have tried to explode the attachment list etc. and even make the globalID populate another field for comparison but I get nowhere.

A few things about the jobs being audited via collector.

  • the file name isn't processed until fme brings inhouse so I cannot compare via filename only.
  • The user may add additional photos at a later date or may delete the existing attachment only to replace with a new one. In that case, they have the same name.

Any help and suggestions would be appreciated,

Thanks all.


2 replies

Badge +6

Hello @bbunch,

Assuming I understand your question properly, I think you are likely on the right track. The attachment list will have to be exploded out, before the UpdateDetector. Secondly, when you are attempting the UpdateDetector, what are you using as the 'Key Attribute', as it sounds like the GlobalIDs are expected to be different if the images are different. If you have an attribute that should be equal across each attachment that is likely the best option.

 

 

Once you have the Updated Attachments, you will have to use a Custom Transformer if you wish to replace the Attachments in FME. As the AGOL/Portal Writers don't current support Writing Attachments. A template workflow example can be found on the FME Hub here: https://hub.safe.com/publishers/safe-lab/templates/attachmentwriter

 

 

I hope that helps!
Badge

Hello @bbunch,

Assuming I understand your question properly, I think you are likely on the right track. The attachment list will have to be exploded out, before the UpdateDetector. Secondly, when you are attempting the UpdateDetector, what are you using as the 'Key Attribute', as it sounds like the GlobalIDs are expected to be different if the images are different. If you have an attribute that should be equal across each attachment that is likely the best option.

 

 

Once you have the Updated Attachments, you will have to use a Custom Transformer if you wish to replace the Attachments in FME. As the AGOL/Portal Writers don't current support Writing Attachments. A template workflow example can be found on the FME Hub here: https://hub.safe.com/publishers/safe-lab/templates/attachmentwriter

 

 

I hope that helps!

Howdy @trenstatsafe

Thanks for your reply. I think I will just have to play around with the lists as I previously did. I don't have any issues bringing the images in. I use a custom photo looper to sort all that.

What I was having difficulty with was exposing the attachment globalID.

I am not writing back to AGOL so that's a bonus.

I will give it another shot.

Reply