Select to view content in your preferred language

Restrict to one survey per geometry in Field Maps

596
5
07-18-2023 03:39 AM
MarcelBeckmann
New Contributor III

I am using Field maps to collect geometries. With the popups in the WebMap we created a link from the Field Map Apps to Survey123 where a survey can be filled out as described here: https://doc.arcgis.com/de/survey123/reference/integratewithotherapps.htm

This is working fine so far. But for every geometry there is the possibility to fill out multiple surveys. This would be a one-to-many-relationship (1:n) . So there can be many surveys for one single geometry.

I would like to implement a one-to-one-relationship (1:1). Meaning for one geometry only one survey can be filled out. Is there a way to achieve this behaviour?

 

5 Replies
GlenShepherd
Esri Contributor

Hi @MarcelBeckmann ,

To my knowledge, in the configuration you've described, there is no setting that we can establish to restrict how many surveys (related records) can be submitted per feature.

However, you could set up the layers in your web map to behave a certain way to prevent additional edits to geomtries that have related records...

  • Create a Spatial Join (using Map Viewer) between the feature layer and the related table, and output a joined view layer. 
  • Apply a filter to the view layer so that you're only rendering geometry that without a related record
  • Add your Survey123 URL to the pop-up of this layer

Now users will only be able to see geometry and complete surveys for records that are yet to be surveyed. And once they have been surveyed, the filter will remove the feature from the web map.

 

Keep in mind, these joined view layers don't work offline unfortunately.

0 Kudos
DougBrowning
MVP Esteemed Contributor

You need to remake the relationship in your service to be a 1:1 relate.  This is probably a republish.  Then Field Maps will stop you from making more than 1.  I only know this because someone created a 1:1 on accident once and we got stopped from adding more records.  Note you will often need to also remake your map since it picks up the relate when you add the layers.  Hope that helps

MarcelBeckmann
New Contributor III

@DougBrowning: Thank you for the information.

As far as I understand I have two objects in my portal. One is a hosted feature layer with my sites. The other object is of type form which is my survey. How exactly can I estimate a 1:1 relate between these two?

 

0 Kudos
DougBrowning
MVP Esteemed Contributor

Oh I thought they were two layers in the same service and you had a relationship class between the two.  If they are two totally different services then you cannot make a relate between them.

What I do it combine and make one service.  Take a look at my write up here  https://community.esri.com/t5/arcgis-survey123-questions/mapping-with-survey123-within-a-polygon-or-... 

This would be a whole new service and I am not sure if that is an option for you.  

Only other idea is to have a calculated expression using FeatureSet and tell the user in the form that there is already an entry.

Hope that helps

0 Kudos
MarcelBeckmann
New Contributor III

Hey DougBrowning,

Thank you for your information. Not sure if I can put everything into one service. The feature class was created in ArcGIS Pro and the form of my survey was created when I publish my service.

Initially, when I was unknowing, I wanted to create a feature class and the necessary tables in ArcGIS Pro make a relationship between them, publish this in a service and tell Survey123 use this stuff for a survey. Then I hit reality! 😜

Your post and the information in the provided link is really good. Gave it kudos! I will give it a try. 

Thanks a lot!