I am trying to get just one vertex from a geotrace question - it seems possible using a JavaScript snippet, but I can't tell how to get into the geotrace output or what data type it is. My working snippet is below, I'm by no means proficient in JS, but this seemed to return at least something:
var lat = 0;
function myfunction(geotrace_data) {
lat = JSON.stringify(geotrace_data);
return lat;
}
Solved! Go to Solution.
Hello @MaryGraceMcClellan,
Here is a sample that calculates the vertex for a specified index, but this index can be hard coded vs dynamically passed in from the survey.
Hello @MaryGraceMcClellan,
Here is a sample that calculates the vertex for a specified index, but this index can be hard coded vs dynamically passed in from the survey.
@ZacharySutherby that is incredible, thank you!!! I was trying to parse the string but this is much more useful.
@ZacharySutherby is it correct that the javascript snippets won't run when users open the survey in the browser? I read before that it wouldn't work in the browser, but I thought that meant if you use the website to develop/publish the survey then you can't use JS. Can you confirm this snippet won't run in the browser even though I published with Connect?