Geotagger question type

I have a form in which I have a question to pick up to 5 locations from a given map view. Functionally, it is similar to what the Geotagger sample form offers, however, in my case, rather than a form in itself, it is a question in one of the forms. I have thought about creating the question as a sub-form and saving the responses in a separate table, but since the Geotagger form runs in ODK Tables instead, I don’t know how to integrate it within an ODK Survey form. Can someone please suggest how can this be achieved? Thanks.

1 Like

To be more specific, I have already created a geotagger sub-form which does what we need. I have this field in a survey that would launch this sub-form. This is all working, but I want the sub-form to be launched in ‘Tables’ rather than survey (so that I can use the geotagger functionality) and return back to the parent survey once filled. Any help please?

1 Like

The odkTables javascript object has functions to open a row in survey:

editRowWithSurveyDefault
editRowWithSurvey
addRowWithSurveyDefault
addRowWithSurvey

If you want to track the row in Tables in your code it is often easier to first add the row using the odkData.addRow so you know the unique id then, use the edit row function.

1 Like

Thanks. Let me attempt this. Will post here how it goes.

1 Like

I tried various combinations but nothing worked so far. I have a feeling that I am not explaining myself well on what I want. Let me put this in a different way -

I have a survey form, from which I want to launch a linked sub-form but in a map view (similar to how the geotagger sample form works). Is this doable?

1 Like

My guess is that the difference is that ODK-X Tables provides the map view in geotagger. It’s NOT a sub-form. ODK-X Survey provides the question rendering (i.e., form rendering). Therefore a sub-form with a map doesn’t quite make sense since ODK-X Tables provides the default map view and ODK-X Survey provides the survey form rendering. Two options, 1) you can implement a custom prompt type in Survey that has the map in it, 2) write a custom interface in Tables to collect the data you want. Both options can be done in HTML/JavaScript in theory. Implementing in Tables is probably more straight forward.

1 Like