Survey overlaid on an existing survey

276
3
Jump to solution
10-26-2022 05:03 PM
BrandonA_CDPH
Occasional Contributor II

This may have been answered somewhere else, but I don't have the vocabulary to know what to search for this. I am probably overthinking this and there may very well be an easy, straightforward solution. Any guidance (even a link to another post) is appreciated. 

I have an existing Survey123 form that feeds a feature service and users really like it and are very comfortable with it. I need to add some additional data fields for a specific project that aren't needed for the main form, but the rest of the data needs to feed into the existing feature service for dashboards and things.  I'm looking for a way to create a Survey123 form that includes fields that feed into the existing form, the project specific fields, and a way to relate the additional and main data (1:1 relationship) so it can all be used in dashboards as needed. I really don't want to have a completely separate dataset for the special project (this is the current situation), and I don't want to clutter the main dataset with the project specific forms.

To (hopefully) help this make sense, here's what I'm trying to do 

Existing Fields

  • Existing1
  • Existing2
  • Existing3
  • Existing4

Project Specific Fields

  • Project1
  • Project2

Project survey includes all fields (Existing1-Existing4 and Project1 and Project2). The existing fields go into the existing Feature Service - Project Specific Fields populate a separate Feature Service - There is a field (automatically generated or, say, Existing1) that links the two tables so I can display, say, fields Existing1, Exising2, and Project1 on a dashboard.

I hope this makes sense to someone other than me. 🤪 Thanks in advance for any help or direction.

0 Kudos
1 Solution

Accepted Solutions
JosephRhodes2
Occasional Contributor II

You can’t submit from a single form to multiple feature services, so you can either:

1. Add the project-specific fields to the feature service and create your new survey in Survey123 Connect, pointing the Submission URL to your existing service, but you said you didn’t want to do that, so you could also:

2. Put the project specific fields in a related table or layer within the existing service and put the project-specific fields in a repeat, setting the repeat_count to 1 to disallow multiple submissions. If you like, you can replicate Existing 1-4 in the related table or layer by using calculations within the form. Not ideal, but possible. Or:

3. Write submissions to a new feature service and use the Python API to copy features with just Existing 1-4 back over to your current feature service. 

View solution in original post

3 Replies
JosephRhodes2
Occasional Contributor II

You can’t submit from a single form to multiple feature services, so you can either:

1. Add the project-specific fields to the feature service and create your new survey in Survey123 Connect, pointing the Submission URL to your existing service, but you said you didn’t want to do that, so you could also:

2. Put the project specific fields in a related table or layer within the existing service and put the project-specific fields in a repeat, setting the repeat_count to 1 to disallow multiple submissions. If you like, you can replicate Existing 1-4 in the related table or layer by using calculations within the form. Not ideal, but possible. Or:

3. Write submissions to a new feature service and use the Python API to copy features with just Existing 1-4 back over to your current feature service. 

BrandonA_CDPH
Occasional Contributor II

Thank you @JosephRhodes2! I'm not real good with the Python API yet, so I think I'll have to go with option 2. Repeats with a limit of 1 repeat! I knew I was overthinking it.

Appreciate the help thinking about that one.

0 Kudos
JosephRhodes2
Occasional Contributor II

You might also want to include a geopoint question inside the repeat, which will make a related layer instead of a related table, so you can just use the related layer in relevant apps (assuming you're copying the values for Existing 1-4 to the repeat). You can set the location of the repeat geopoint based on the parent geopoint with the following:

pulldata(@"geopoint", ${name_of_parent_geopoint_question}, "y")+" "+pulldata(@"geopoint", ${name_of_parent_geopoint_question}, "x")