AnsweredAssumed Answered

Adding attachments using GlobalId when sync fails from Collector

Question asked by r3weber on Dec 13, 2017
Latest reply on Jan 8, 2018 by MKellyesri-ireland-ie-esridist

We have had issues with sync failing at times when our inspectors return from the field.  This seems to happen for various reasons.  When it does we have to do quite a bit of manual loading of data to our data collection layers in Arc Online.  The biggest hassle is with the attachments.  I can add attachments using the global id of the feature in the service in AGOL and related global id of the attachments once they are taken from the runtime GDB to a local folder.  My issue currently is with handling features that already have the necessary attachments.  Especially those features that have more than one attachment.

 

I am not a python expert but have gotten this far using the API it would be nice to have something to automate this task when we have this issue.Michael Kelly any thoughts would be much appreciated.

 

Currently the script runs fine when there are no attachments or it needs to add only one more attachment to a feature.  The issue comes when multiple attachments already exist.  Whatever I am doing is not iterating past the first attachment it finds so it adds duplicates.  In particular lines 34-37. It finds the name of the existing attachment and matches it to the filename but only for the first attachment of a particular feature.  I am hoping this is just something simple I am missing.   General pointers on organization of for and if statements would be greatly appreciated. 

Outcomes