Select to view content in your preferred language

Survey123 feature class as a related table

38248
87
Jump to solution
08-22-2016 09:43 PM
GordonSumerling
Esri Regular Contributor

Hello All,

I need to understand how it might be possible for my Survey123 feature class to be a related table to a polygon feature in the map.

In essence I have a farm field feature class and I want to perform an inspection against this. Conventionally, I would create a feature class to represent the farm in ArcMap and then create a related feature class in ArcGIS that is the inspection feature class. Now I could use this in collector. However, I want to take advantage of the field manipulation capability of Survey123. 

The inspector already knows the farm ID so he just needs to perform the inspection with survey123. So the question is how do I publish the survey123 feature class and then relate it to the farm polygon feature class in ArcGIS Online?

Cheers

Gordon

87 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Liina,

I would need to see the form to be able to comment further- can you attach it?

0 Kudos
LiinaTamm1
New Contributor II

Hi James,

Yes, ofcourse. You can find it here test2k.xlsx - Google Drive 

0 Kudos
LiinaTamm1
New Contributor II

Do you know if there is a solution JTedrick-esristaff ?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Liina,

My apologies, this week has been very busy.  Looking at your survey, you have substring the calculation for the globalid in the same question- you can't have a recursive calculation like that.  You will need to have it populate another question first before being extracted.  

In 2.4, this will be much easier as we are introducing the ability to have 'temporary' or 'intermediate' questions - they are usable in the form but do not submit data.  The 2.4 beta is available from the Early Adopter Community if you want to try that out- we expect release in mid-September.

0 Kudos
LiinaTamm1
New Contributor II

Hi JTedrick-esristaff,

So in ArcGIS Online I was able to integrate Collector with Survey123. But now I am using Portal and my aim is the same - open my survey from Collector. My survey is created on an existing feature service, which constists of a point layer and a related table. The layer and the related table are on ArcGIS Server. The problem is the same as previously - my records are orphaned. My submission URL is arcgis-survey123://?itemID=a6f3b9ecc57c4bff83b14189b81914d4&field:parentglobalid={GlobalID}. When I open a point's popup and view the URL, it is like this arcgis-survey123://?itemID=a6f3b9ecc57c4bff83b14189b81914d4&field:parentglobalid=%7B73B55B47-4A14-4221-8989-F82EAB06C14E%7D So in ArcGIS Online I did not have the problem with curly brackets (the URL was exactly the same as I mentioned before). 

I do not want to make column for the point layer, where I remove the curly brackets, because then I have to update the column every time someone adds a new point. 

How can I pass the URL from web map and Collector without the curly brackets? I already tried the calculation which was suggested before, but it did not help. 

Here is the form

0 Kudos
ChrisGoessl
New Contributor III

Liina,

In column U (bind::esri::fieldType) row 21(Parentglobalid) the field needs to be changed from esriFireldTypeGUID to NULL.

The reason behind this is so the {} will not be placed back into the related table. There is an issue with the portal system trying to place another set of {} on the GUID fields.

Hopefully this works for you.

Christopher Goessl, GIS Technician | City of Kettering

3600 Shroyer Road | Kettering, Ohio 45429

v. 937.296.3209 | christopher.goessl@ketteringoh.org | www.ketteringoh.org

Email to and from the City of Kettering is open to public inspection under Ohio's public record law. Unless a legal exemption applies, this message and any response to it will be released if requested.

>>> Liina Tamm <geonet@esri.com> 01/08/18 5:36 AM >>>

GeoNet Re: Survey123 feature class as a related table reply from Liina Tamm in Survey123 for ArcGIS - View the full discussion

Hi

James Tedrick,

So in ArcGIS Online I was able to integrate Collector with Survey123. But now I am using Portal and my aim is the same - open my survey from Collector. My survey is created on an existing feature service, which constists of a point layer and a related table. The layer and the related table are on ArcGIS Server. The problem is the same as previously - my records are orphaned. My submission URL is arcgis-survey123://?itemID=a6f3b9ecc57c4bff83b14189b81914d4&field:parentglobalid=. When I open a point's popup and view the URL, it is like this arcgis-survey123://?itemID=a6f3b9ecc57c4bff83b14189b81914d4&field:parentglobalid=%7B73B55B47-4A14-4221-8989-F82EAB06C14E%7D So in ArcGIS Online I did not have the problem with curly brackets (the URL was exactly the same as I mentioned before).

I do not want to make column for the point layer, where I remove the curly brackets, because then I have to update the column every time someone adds a new point.

How can I pass the URL from web map and Collector without the curly brackets? I already tried the calculation which was suggested before, but it did not help.

Here is the form

Reply to this message by replying to this email, or go to the message on GeoNet Start a new discussion in Survey123 for ArcGIS by email or at GeoNet Following Re: Survey123 feature class as a related table in these streams: Inbox This email was sent by GeoNet because you are a registered user.

You may unsubscribe instantly from GeoNet, or adjust email frequency in your email preferences

Spam

Phish/Fraud

Not spam

Forget previous vote

0 Kudos
LiinaTamm1
New Contributor II

Hi Chris,

Thank you so much for replying! I tried this suggestion before and it failed. My records are still orphaned. I will describe the workflow I did. Maybe I forgot some steps. 

1. For the related table I added the pareynglobalid ja Global_test fields and both of them are GUID. The table also has GlobalID field. The relatsionship between the point layer and the table is through GlobalID and Global_test.

2. Created a new survey with existing feature service. Deleted the fields which refer to the parent layer and statments begin and end. 

3. Added two note fields parentglobalid and Global_test. parentglobalid bind::esri:fieldType is null and Global_test bind::esri:fieldType is esriFieldTypeGUID.

4. Added calculation if(string-length(${parentglobalid})>36,substr(${parentglobalid}, 1, string-length(${parentglobalid}) - 1),${parentglobalid}) for Global_test to remove the curly braces. 

5. Changed the form_id so it refers to the related table.

6. Created the custom url arcgis-survey123://?itemID=a6f3b9ecc57c4bff83b14189b81914d4&field:parentglobalid={GlobalID} and added it to the popup. When I copy the address link from a point's popup the curly braces are replaced with %7B and %7D.

What could be the problem? The aim is to remove the curly braces so when I create the custom URL, the URL of a point shows global id without the curly braces. 

0 Kudos
ChrisGoessl
New Contributor III

Liina,

Sorry, been busy around here.

Here are my thoughts about your table.

1. Global_Test field = Is this field in your feature table related to you feature class?

2. You name the fields to match what is related back to your feature. 

3. The field type for row 21 and 22 should be "text" and not "note".

4. The formula that you have in calculation, needs to be placed on the field that will be brought back into your table that relates back to you the feature.

Here is an example:

*In the related table I have two fields, ParentID (GUID) and ParentIDOrig (GUID). The purpose is to have the ParentIDOrig accept the GlobalID movement when Survey 123 is started. The ParentID is the connect point between the Feature and Table.

*Feature Class is related 1:M to table with Feature (GlobalID) to Table (ParentID)

*When creating the url connection to the survey I used arcgis-survey123://?itemID=a6f3b9ecc57c4bff83b14189b81914d4&field:ParentIDOrig={GlobalID}. The purpose is to have the GlobalID move to a field that is not related between the two features.

*In the ParentID calculation field on Survey123, this is where I added the following calculation: if(string-length(${ParentIDOrig})>36,substr(${ParentIDOrig}, 1, string-length(${ParentIDOrig}) - 1),${ParentIDOrig}). What this does is pull the information from the ParentIDOrig field and remove the {} from the end points and place it in the field on the table that is related back to the original feature.

* In the ParentIDOrig "bind::esri:fieldType" field  will need to be 'null'. You do not want this data to be reimported into the table. For some reason this will create an error. 

* In the ParentID "bind::esri:fieldType" field will need to be 'esriFieldTypeGUID'. 

 

Hopefully this helps. Let me know if there are any more issues.

IngridMans
Occasional Contributor II

Will this also work if the OriginalParentID and ParentID fields are hidden or read only?

0 Kudos
YukunXing
New Contributor III

Hey Chris, I tried to follow your example. In my case "ParentID" is the foreign key of the related table. However, I couldn't add it as a field to the survey. If I do, I get this error when trying to upload the survey:

The custom feature service submission url is not compatible with this survey (Field ParentID in Inspections is not editable)"

Any guess what I might have missed? Thanks!

0 Kudos