Add new rows to existing Survey123 table

1199
6
Jump to solution
08-26-2020 07:22 AM
RobertBorchert
Frequent Contributor III

I am trying to configure a new Survey123 to add rows to an existing survey table.

I am using the newest versions of everything.

Background: A person in Project Management creates Issue numbers.  She has the ability to add work groups on at the same time using the repeat feature.  But she may not know all the work groups at the time of Issue Creation.

I would like to be able to have her select the existing point feature that was originally created for the Issue.  And add new records onto the related Table that contains the work groups.

I have tried it by taking out the center= x,y but it simply creates a point at my current location.

is there something  I need to add to my link or a setting in survey creation to add rows?

arcgis-survey123:///?itemID=<survey>&field:PROJNUM={PROJNUM}&field:ISSUENUM={ISSUENUM}&field:LOCATION={LOCATION}&field:LOCDESC={LOCDESC}&field:PROJDESC={PROJDESC}

0 Kudos
1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

Ok. If you want to create a new row into the repeat table using a custom URL scheme call, then you need to:

* Configure your survey to target the related layer, as opposed to the main layer

  * Use the submission_url setting to target your feature service first

  * Use the Form_ID setting to indicate the name of the related table (coincides with the name of the repeat)

  * Add the GUID field used in your geodtabase relationship to your worksheet (as a hidden field with the appropriate esriFieldType set) e

* In the survey worksheet drop the begin and end repeat as well as all the questions outside the repeat

* When invoking the custom URL call, include the GlobalID of the parent record (as a parameter with field:) and store it in the GUID field in your related table used for the geodatabase relationship. This will ensure the new row is added as a related record to the issue you selected.

View solution in original post

0 Kudos
6 Replies
IsmaelChivite
Esri Notable Contributor

Hi.

You may want to try this:

In Survey123 Connect, enable the Inbox for your survey, disable the Sent folder and publish.

In the field app, now you will see the Inbox, which you can use to retrieve existing data. You may want to use the instance name property to set the labels in the Inbox to your liking.

The contents of the Inbox can be visualized as a map for navigation or as a list (which you can sort).

Open the survey as appropriate from the list or map and add new rows.

For reference:

* https://community.esri.com/groups/survey123/blog/2017/04/24/understanding-the-instancename-setting 

* https://community.esri.com/groups/survey123/blog/2020/04/09/survey123-tricks-of-the-trade-repeats 

Note: You can configure your Inbox with a query to reduce the amount of records shown in the list and map. For example, you can use the query to just show records that you expect the end user to process. More info at: Prepare for editing existing survey data—ArcGIS Survey123 | Documentation 

0 Kudos
RobertBorchert
Frequent Contributor III

Thanks for the response.  We are trying to avoid the use of the inbox as there will be hundreds of Surveys in the In Box

0 Kudos
IsmaelChivite
Esri Notable Contributor

Ok. If you want to create a new row into the repeat table using a custom URL scheme call, then you need to:

* Configure your survey to target the related layer, as opposed to the main layer

  * Use the submission_url setting to target your feature service first

  * Use the Form_ID setting to indicate the name of the related table (coincides with the name of the repeat)

  * Add the GUID field used in your geodtabase relationship to your worksheet (as a hidden field with the appropriate esriFieldType set) e

* In the survey worksheet drop the begin and end repeat as well as all the questions outside the repeat

* When invoking the custom URL call, include the GlobalID of the parent record (as a parameter with field:) and store it in the GUID field in your related table used for the geodatabase relationship. This will ensure the new row is added as a related record to the issue you selected.

0 Kudos
RobertBorchert
Frequent Contributor III

I had my relates set up using GLOBALID and REL_GLOBALID (GUID)

I added the GUID to the url to populate it with the global id.  However, it still created a new point and it took the globalid from the new point and put that in the guid field.

0 Kudos
ZacharySutherby
Esri Regular Contributor

Hello Robert Borchert‌,

Here is an article that discusses the workflow Isamel mentions above: How To: Populate a related table from a Survey123 for ArcGIS feature service for Collector for ArcGI... 

Thank you, 

Zach

Thank you,
Zach
RobertBorchert
Frequent Contributor III

Zachary and everyone else. Thanks for assistance.  The workflow Isamel used and the link Zachary provided worked perfectly.

In a nut shell. I copied the original survey in Survey123 connect and gave it a new name.

Remove all references to the original point feature

Remove repeat functions

In settings change the name of form_id to the name of the form you want to update

and very importantly you need to add the relationship guid you used to create the form to the survey and auto populate it from the globalid in the url link. Our company as a standard calls the guid REL_GLOBALID.  For safety in the form make it read only.

Once again thanks

0 Kudos