Solved

How to download certain features from an AGOL hosted service that have attachments and then write them (feature + attachments) into an existing SDE database?

  • 9 December 2022
  • 2 replies
  • 5 views

I know this question has been asked in many various forms, and I know the key is to correctly define the relationship between the feature and its attachment prior to writing, but we're struggling. I've attached a snapshot of a demo workspace.

 

Any help is appreciated.

 

Thanks!

icon

Best answer by mk_gdic 13 December 2022, 20:57

View original

2 replies

Badge +7

Looking at your Workbench my first thought is that is might be the order of your writers. You cannot write to your attachments before the related feature exists in the main Feature class.

 

Also it is important to know on which field your relationship is working. Is it on the OBJECTID or on the GlobalID? If it is on the OBJECTID then you basically cannot (I think) use the classic writers and need to use the FeatureWriter to first write your features without the attachments. Reread the features you just wrote away so you can get their new OBJECTID and merge this new OBJECTID to your attachments before also writing the attachments.

Thanks Birgit...... there ended up being a number of things incorrect in our first attempt.

We were finally able to get it to work as expected by adapting the workspace template from this post.

I've attached an image of our workspace with annotation.

 

 

Reply