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?
Solved! Go to Solution.
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.
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.
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.
That sounds like it could be in the layer's settings, perhaps? In recent updates, they enabled field-level editing settings.
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?
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.
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.