Survey123 feature class as a related table

37091
87
Jump to solution
08-22-2016 09:43 PM
GordonSumerling
Esri 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
AhjungKim4
Occasional Contributor II

I believe you can achieve that with Arcade.  A caveat is Collector doesn't work well with Arcade at the moment.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Aaron,

You could do this in the survey form- have the globalid come into a text file question and then use a substr() function to remove the curly braces

substr(${incoming}, 1, string-length(${incoming}) - 1)

0 Kudos
AaronThompson
New Contributor III

Ahjung, thanks for the reply! I'd prefer not to go that route, if at all possible.

James, I'm not sure if I know what you mean by having the globalid come into a text file?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Sorry- that should be text question

0 Kudos
MaxMarno
New Contributor III

@ Ishmael Chivite

    Can you tell me a bit more about this added functionality for related tables in Survey123?  

    I have a workflow I would like to implement that involves the following criteria:

1). Edit, add, and delete features, AND related records from the same survey

2). Display the related records in the survey in tabular form

3). pulldata() from external, or just edit/update existing

Is this possible using Survey123?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Max,

  1. Currently, Survey123 supports:
    1. Adding - You can add data to a parent and related table using either 1 form with questions for both tables or 2 forms (each table gets it own form).
    2. Editing - You can currently edit related records when they are in their own form (the form for each table approach).  Survey123 currently does not support editing surveys that have questions for both the parent and the related table; this is something that we plan to bring into the application in the future
    3. Deleting - Survey123 does not support deleting records currently.  Limited deletion may accompany the editing of related records; in general, ew would recommend the creation of a web app to do post-survey QA work if deleting survey records is a major part of the workflow
  2. Display of records - We plan to improve the display via the Data tab on the Survey123 website.  Additionally, there are numerous other apps with tabular visualization available via the ArcGIS Organization the survey is in (ArcGIS Online/Portal)
  3. Can you define a bit more closely what you are asking about - what workflow are you wanting the pulldata to participate in?
0 Kudos
MaxMarno
New Contributor III

Thanks for getting back to me James. I believe that we actually spoke earlier this year during the holistic testing, but I am now trying to determine if Survey123 can accommodate the workflow as of the 2.0 release.

I have apartment building features, with a related table describing the rent, and sqft of each unit style/apartment type, within each apartment building. I’ll refer to this as the ‘unit mix’ data from now on.

The form will be used to collect and update the general apartment building details, as well as the unit mix data. It is my understanding that this could be done by either editing existing records (however not the parent features, and related table?) OR by loading the existing data as default values..(pulldata()?)

The most recent unit mix data needs to be presented as default values for reference and so that the can just be verified if there has not been a change. Similarly it would be best to display all of these rows in tabular form so that they can be visually compared.

Some of the apartment buildings have more than 50 different unit styles.

Can you describe which other apps you are referring to for displaying related records? Are you aware of any that allow a tabular display as well as add, delete, and update capabilities?

Thank you,

Max

0 Kudos
CinthiaEichhorn
New Contributor III

This looks interesting.  Each time I try this I receive a Code 1000 error message "The INSERT statement conflicted with the Foreign Key constraint....column 'GlobalID'.  I had a geodatabase of wetlands and a related wetlands condition table, published as a feature service, followed the steps in this post, but keep receiving a Code 1000 error.  Did the related table need to be layer 0?  I have the related table named in the FormID.

Thanks,

Cinthia

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Cynthia,

It sounds as if you are attempting to duplicate a GlobalID on submittal.  Is the GlobalID exposed in your form?  Does this form just collect new records, or add & update existing records?  Are you using this form along with Collector or another way to open Survey123 automatically?

0 Kudos
CinthiaEichhorn
New Contributor III

Hi James,

I did fix the GlobalID issue.  The form collects new records, and we are using it along with Collector.  The issue now is orphan records are being created rather than the information going into the related table.  From looking through this forum, seems as though others have encountered the orphan record issue as well.  I will try some of those suggestions.

Thank you for the quick reply.

0 Kudos