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.
concat(number(pulldata('centroids','x','county', ${county}))," ",number(pulldata('centroids','y','county', ${county})))
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
Philip Wilson - got anything for me on this one? Thanks in advance!
Hi James,
Does the geopoint question ever become relevant, or always not relevant but you want to capture a position for it? Can you share your xlsx file?
Phil.
Yes it becomes relevant for all other sample types. I'll try to attach xlsx spreadsheet.
Not sure how to attach spreadsheet so here is a copy on my google drive.
Hi James,
You can attach the xlsx file to the reply/post using the "Use advanced editor" option (top right corner of reply when open in new window/tab (not in Inbox).
Phil.
Hi James,
You calculation relies on a pull data with CSV - it would be helpful to attach that as well.
Another technique you could use to debug this form is to migrate the pulldata calculations to notes to make sure that it's being read properly, and calculate the geopoint based on the notes.
I'll also note that Survey123 expects a Latitude, Longitude (y,x) pair, not an x,y pair, which is what you apparently are trying to calculate.
When a relevant is hidden it will always be "" string. No way around that. (Except for the default values bug.)
You could use the hidden type or something maybe?