How can I calculate default coordinates for my geopoint question when it is not a relevant question?

1358
8
08-29-2019 09:45 AM
JamesKelly4
Occasional Contributor

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 GeonetSurvey123 (Admin)Survey123 SurveyJames TedrickIsmael Chivite

Tags (1)
0 Kudos
8 Replies
JamesKelly4
Occasional Contributor

Philip Wilson‌ - got anything for me on this one? Thanks in advance!

0 Kudos
by Anonymous User
Not applicable

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.

0 Kudos
JamesKelly4
Occasional Contributor

Yes it becomes relevant for all other sample types. I'll try to attach xlsx spreadsheet. 

0 Kudos
JamesKelly4
Occasional Contributor

Not sure how to attach spreadsheet so here is a copy on my google drive.

0 Kudos
by Anonymous User
Not applicable

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.

0 Kudos
JamesKelly4
Occasional Contributor

10-4. Sorry for slow followup. Please see attached.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

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.

0 Kudos
DougBrowning
MVP Esteemed Contributor

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?  

0 Kudos