Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need better handling of select_multiple data on export #96

Open
danbjoseph opened this issue Dec 6, 2016 · 3 comments
Open

need better handling of select_multiple data on export #96

danbjoseph opened this issue Dec 6, 2016 · 3 comments
Labels

Comments

@danbjoseph
Copy link
Member

formhub is nice in that in the data export it will also add a column for each option and then will have a boolean to show if that option was selected. makes it easier to analyze. omkserver just puts the selected values in the single column as space separated:
screen shot 2016-12-05 at 7 49 44 pm

@danbjoseph danbjoseph added the IROC label Dec 6, 2016
@danbjoseph
Copy link
Member Author

  • would be nice to have: "marktype": "1 2 4", also be represented in the json data as:
"marktype/1": true,
"marktype/2": true,
"marktype/4": true,
  • so then the OMK csv output could have a column for each so (or N/A or null or whatever for false)
marktype  |  marktype/1  |  marktype/2  |  marktype/3  |  marktype/4  |  marktype/5
------------------------------------------------------------------------------------
1 2 4     |  true        |  true        |  false       |  true        |  false

what's the best way to accomplish this?

  • xform-to-json can be passed a field name to use for the geojson coordinates when the output is meant to be geojson format. should we see about introducing a option where you can pass an array of field names to be interpreted as select_multiple and do the above? OMK Server can read the form xml and find get the field names for questions with type="select" (these are select_multiple, and select_one show up as type="select1") before converting submission data?
  • if we would need to get the question field names anyways, just process the json after xform-to-json, splitting the value on spaces and then creating the needed key/value pairs from it?
  • ???

@mojodna
Copy link
Member

mojodna commented Apr 13, 2017

xform-to-json only knows how to handle submissions. We needed some way to understand the structure of the XForm itself. util/xform.js now includes a parser that will pull out the instance name (usually the filename) as well as field names. Select values can later be extracted using similar techniques (which is now done in aggregate-submissions.js to expand submission fields per ^^).

image

@danbjoseph danbjoseph reopened this Oct 10, 2017
@danbjoseph
Copy link
Member Author

posm/posm#278

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants