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?

  • December 9, 2022
  • 2 replies
  • 117 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!

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.

 

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

birgit
Influencer
Forum|alt.badge.img+21
  • Influencer
  • 131 replies
  • 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
  • 2 replies
  • 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.