How to create a survey related data model in an enterprise geodatabase?

915
5
07-24-2018 02:56 AM
JürgenBiendara1
New Contributor III

Hello,

I have successfully created and published a Survey123 form in my ArcGIS Enterprise environment. Now I want to create an identical form and use a hosted feature service that runs against my enterprise geodatabase.

The question is: What is the easiest way to create the database model in my enterprise geodatabase?

From my perspective, the easiest way would be some kind of copying and pasting the data model that was created by publishing the survey from the data store to my geodatabase.

I also found this blog post, which speaks of "...create the tables in the enterprise geodatabase to store the data".

https://community.esri.com/groups/survey123/blog/2016/12/14/migrating-data-from-the-survey-feature-s...

Any suggestions, how to accomplish this request?

And a second question: Once I have created the data model in my enterprise geodatabase, (how) can I switch an existing Survey123 form to the related feature service?

Thank you very much, best regards,

Jürgen

0 Kudos
5 Replies
DougBrowning
MVP Esteemed Contributor

I used this flow.  It is based on using collector but concepts the same.

 

Create the form and publish.

Download the form feature service as a gdb.

Create a new GDB in catalog - this holds your collector features.

Add the FS that collector is going to use (point, line, whatever).

     Add a key field to the collector class then pass this value to Survey123 (like you have been doing).

Copy the Survey123 FC you downloaded into the collector gdb.

Create a Relationship class from the Collector FC to the Survey123 FC.

Publish this gdb as a service.

Go into the Survey123 form and set the submission_url to the new HFS you just published.

Republish the form.

 

Now you can add the collector service to a map and all the relationship classes come along.  Now you have your collector features connected to your forms.  Forms to lines or polygons or whatever does not matter.

 

I have this working with 9 forms/9 relationships classes and works great.  I can list all the forms for a feature or open a form and backtrack to the feature.  Plus if you export the HFS to a GDB all the relationships classes come with it.  They also works in ArcMap when connecting to the HFS directly.  Oh and you can even see the linked forms in Collector - even other peoples forms!

 

Also what I did was add a field called XForm and put the item id in that field.  Then in the collector map I can use that field to construct the URL.  It then launches and prefills in the "Key" field you decided to use.  This way you can actually mix and match forms if you want.  Say 2017 features link to the 2017 form but the 2018 features link to the 2018 form.

 

Hope that makes sense and helps you. 

JürgenBiendara1
New Contributor III

Hi Doug,

Thank you very much for your help, I think I understand how to accomplish the trick. I've prepared and published the feature service working with my enterprise geodatabase in ArcGIS Enterprise and set the submission_url of my survey to the item id of the feature service (the url that can be seen in Portal):

http://vsdev2147.esri-de.com/portal_wa/home/item.html?id=a23d19450c364fbab11e6fdd55b08039

Now, when I try to republish the survey, I get this error:

The custom feature service submission url is not compatible with this survey (Request error Missing serviceItemId)

If this url is not correct, which other url do I need to set in my survey Excel sheet and where do I get it from? Do you have any idea or hint?

Thanks once again, best regards,

Jürgen

0 Kudos
DougBrowning
MVP Esteemed Contributor

The URL should be to the Feature Service REST URL not the item page ( so it should end in /FeatureServer like  http://stuff/FeatureServer).  In the bottom right of the item page under Layers section you will see each layer listed with a link to the Service URL - this is the one you want in the form settings page.

Also make sure you use the name in the Layers list in the form_id field next to the URL on the settings page.  This is how it finds the exact layer to use.  This also allows you to have multiple forms pointing to the same master feature service.

Hope that helps.

0 Kudos
JürgenBiendara1
New Contributor III

Hi Doug,

When I use the feature server address I get an code 498 invalid token error. This is, I think, because I am using Portal (see The custom feature service submission url is not compatible with this survey (Request error 498 inva...).

This post also references a screenshot from a article in the ArcGIS online documentation (Use Survey123 with existing feature services), unfortunately, this screenshot misses the form_id entry and the url is an arcgis.com address.

Which leaves me at the beginning of my quest. This is what I have:

But this configuration raises the "Missing serviceItemId" error.

I have no idea, what I am doing wrong or what's missing.

Thanks,

Jürgen

0 Kudos
DougBrowning
MVP Esteemed Contributor

I see now that portal is different but I still think your URL is wrong.

On the links you posted James post has this sample URL

See how the word "rest" in in there. 

But in your URL above "rest" is not in there.

But I do not know how to get that URL.  You may be able to just type it based on the above.

What URL do you get when you click here

Sorry I have not done this with Portal so that is all I know.

0 Kudos