Skip to main content
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?


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!

Best answer by mk_gdic

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.

 

 

View original
Did this help you find an answer to your question?

2 replies

birgit
Influencer
Forum|alt.badge.img+16
  • Influencer
  • December 12, 2022

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.


  • Author
  • Best Answer
  • December 13, 2022

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.

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings