Adding point feature and related table info and key field for relationship

612
6
Jump to solution
06-08-2021 09:41 AM
JasonCyphers
Occasional Contributor III

Two-part question:

Is it possible to create a survey that adds a point feature AND a related table record upon submission?

If so, what's the best way to set up the relationship between the feature and table?  I created a "point_feature_id" text field and a "related_table_record_id" text field that the relationship is built from.  In Survey123, I used a calculation of "uuid()" (which creates a unique id similar to: 910fe065-5c1d-4a92-be33-27f1d6e9abc2) to populate the point_feature_id field; I then used a calculation to make the related table record's ID field populate with the point_feature_id field.  Only issue I'm running into is that Survey123 evidently doesn't allow relationships to be built from text fields.  Is there another way to build the relationship?

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Notable Contributor

Have you tried adding the "related id" as a GUID field? Relating parent globalid → child guid is usually the best way to do it. In fact, according to the S123 docs:

Survey123 only supports one-to-many GUID relationships when working with existing feature layers and related tables.

We have a few surveys for doing just this sort of thing, and it works well when the relationship is established that way, both for adding new and editing existing records.

- Josh Carlson
Kendall County GIS

View solution in original post

0 Kudos
6 Replies
jcarlson
MVP Notable Contributor

Have you tried adding the "related id" as a GUID field? Relating parent globalid → child guid is usually the best way to do it. In fact, according to the S123 docs:

Survey123 only supports one-to-many GUID relationships when working with existing feature layers and related tables.

We have a few surveys for doing just this sort of thing, and it works well when the relationship is established that way, both for adding new and editing existing records.

- Josh Carlson
Kendall County GIS
0 Kudos
JasonCyphers
Occasional Contributor III

That did it.  I wasn't sure if GUID fields were editable in Survey123.

Another issue I'm running into is being able to re-open the survey to modify related table records after submitted, specifically date/time fields.  I have a "name", "time in" and "time out" field.  After I submit the form, then come back to try to edit the "time out" field, it is not editable.  The "name" text field is though, so I'm confused.

0 Kudos
jcarlson
MVP Notable Contributor

That sounds like it could be in the layer's settings, perhaps? In recent updates, they enabled field-level editing settings.

- Josh Carlson
Kendall County GIS
0 Kudos
JasonCyphers
Occasional Contributor III

This is being done in an enterprise portal, v10.8.  I'm not aware of any field-level editing settings.  Even if I try to add an additional related table record, the date fields are grey'ed out and are un-editable.

Also (and I think this is simply a limitation of Survey123), I have 2 image fields set to an appearance of signature that that are used to capture a signature when the form is first submitted, then when it's reopened and edited, a signature to indicate the work is complete.  After submitting, I'm unable to add a second signature.  Any workaround for this?

0 Kudos
JasonCyphers
Occasional Contributor III

Figured out the editing of related table data after submitting form.  Added "allowUpdates=true" to the bind::esri:paramaters column for each of the repeats.

Still don't have a solution to add a second signature after the form has been submitted.

0 Kudos
jcarlson
MVP Notable Contributor

Ah, yes. It's a 10.9 setting.

You might try having two surveys, one for adds, one for updates, if there are certain fields or questions that would not be filled in on the initial add.

- Josh Carlson
Kendall County GIS
0 Kudos