In my survey the geopoint question is relevant for all but 1 sample type. This is because county is the highest resolution location data that we get for this 1 sample type. However, I would like the default coordinates for this sample type to be the centroid of the selected county. I can get this functionality to work on all of the sample types that are relevant for this question with the following formula and by having a csv file (centroids) in the media folder with x,y coordinates for centroid of each county.
<SPAN class="token function">concat</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="token function">number</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="token function">pulldata</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'centroids'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'x'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'county'</SPAN><SPAN class="punctuation token">,</SPAN> $<SPAN class="punctuation token">{</SPAN>county<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">" "</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="token function">number</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="token function">pulldata</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'centroids'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'y'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'county'</SPAN><SPAN class="punctuation token">,</SPAN> $<SPAN class="punctuation token">{</SPAN>county<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>I was hoping it would still do the calculation for the sample type for which the geopoint question is not relevant, but it is not. It still returns x and y values of 0, placing the point off the coast of Africa.
Any help is appreciated! Survey123 Geonet Survey123 (Admin) Survey123 Survey James Tedrick Ismael Chivite