How to prefill geopoint in enketo form through URL

I want to pre fill geopoint(latitude,longitude,altitude,accuracy) through URL?
it's input type is "number"
i tried like this :[/data/myformname/lat]=28.5825583292
but it not reflected in form. Can anybody help?

Hi Ashish,

I recommend to not try to craft URLs manually but use the API instead. If that doesn't work, please share the API request you are making and the issue you are having. We also make no effort to keep URLs the same over time (but the API will be stable and is versioned).

Good luck,

@martijnr thanks for your response. My data is coming from api itself. But just for testing i want to know how we can pre fill data from url, only then i can fill that field from my api

I think the value is the issue, if you are trying to populate a geopoint value directly. See the space-separated format (like 10 10 10 10) that Collect or Enketo submits to your server for a geopoint field. Also make sure to URL encode the query string when you are testing manually-crafted URLs.

Can you please give me example how can i write these values in to URL. Because i am not able to understand how i can give those values. Please, it will help me. Suppose my base url is: http:// .then how can i pass those values?

Sure, this is a live example that set the first geopoint question in the form to value 10 11 12 13:[%2Fwidgets%2Fgeopoint_widgets%2Fgeopoint_map]=10%2011%2012%2013

I used Enketo's API to get this URL.

In your browser's javascript console paste this to see the decoded URL:


See our XForms spec to understand the space-separated geopoint value.