Select to view content in your preferred language

Survey123 Connect Pulldata(@layer using coordinates for the location

183
4
4 weeks ago
MHergel
Occasional Contributor

Hello,

I am working in Survey123 Connect and I have a survey where users draw a polygon on a map. I have set up the survey to create an approximate centroid for the polygon (using JavaScript) to generate coordinates that will be included in the survey report. I originally created a geopoint with these coordinates and used the point in polygon and Pulldata(@layer...) to identify the Township name, Concession, and Lot numbers for the location of the polygon. Although I cannot publish this because it leads to a geopoint and geoshape in the same repeat. When I moved the geopoint outside of the repeat setup for the polygon the coordinates no longer generate, so it seems this must be inside of the repeat to work. 

I am wondering if it is possible for the location parameter to be a set of coordinates using the coordinate values I have already created? Or is there a workaround that I could use?

Thank you,

Mayva

She/Her

0 Kudos
4 Replies
MaazaMekuria
Frequent Contributor

Did you try getting the particular instance of the repeat?  The geopoint data maybe confused as to whcih instance of the repeat to extract the centroid from.  Check out the documentation of extracting repeat values at Repeats—ArcGIS Survey123 | Documentation and specifically the indexed-repeat() function syntax might help.  

0 Kudos
MHergel
Occasional Contributor

Thank you for your replay!

I tried moving the geopoint outside of the repeat and using the indexed-repeat() and everything worked if I drew only one polygon but when I drew multiple polygons the index repeat was returning null values for all polygons in the repeat. Maybe I set it up incorrectly. I was able to restructure my form layout so that it would take the geopoint of the first polygon no matter how many were drawn.

Thanks again!

0 Kudos
Neal_t_k
Frequent Contributor

I  wonder if you "null" the field where you calculate the centroid, if it would publish? If you don't need to record the centroid and only need the coordinates for the pulldata, I would at least try setting the binf::esri:fieldType to "null" and see if it would publish?  If you are not creating two geometries in the same repeat in the feature layer but only the form, it might work.

0 Kudos
MHergel
Occasional Contributor

Thanks for your replay! I did end up doing something very similar to this where I moved the geopoint out of the repeat and set it to null and hidden and it seems to be publishing now.

Thank you again!

0 Kudos