Duplicate keys in JSON generated from Aggregate

I have an xml form whose structural instance looking like this:

  <section_1>
     <question_1 />
  </section_1>

  <section_2 />
     <question_1 />
  </section_2>

Both section_1 and section_2 are not repeating groups. The problem is the
exported json for aggregate ends up having duplicate keys as shown below.
Most parsers will ignore one of the two (in this case) key-value pairs
because technically json objects should not have duplicate keys. know I can
export the data as CSV but is there a work-around for this problem?

[
{
"question_1":"answer for question 1 in section 1",
"question_1":"answer for question 1 in section 2"
}
]

Hi Jason,

One option is to publish to a JSON server and you'll get the group
structure in the JSON post. See
http://opendatakit.org/use/aggregate/data-transfer for more on what
other data transfer options preserve group structure.

Another option is to rename the question prompts to section1_question1
and section2_question1

Yaw

ยทยทยท -- Need ODK services? http://nafundi.com provides form design, server setup, professional support, and software development for ODK.

On Fri, Jan 31, 2014 at 6:37 AM, Jason Rogena jasonrogena@gmail.com wrote:

I have an xml form whose structural instance looking like this:

  <section_1>
     <question_1 />
  </section_1>

  <section_2 />
     <question_1 />
  </section_2>

Both section_1 and section_2 are not repeating groups. The problem is the
exported json for aggregate ends up having duplicate keys as shown below.
Most parsers will ignore one of the two (in this case) key-value pairs
because technically json objects should not have duplicate keys. know I can
export the data as CSV but is there a work-around for this problem?

[
{
"question_1":"answer for question 1 in section 1",
"question_1":"answer for question 1 in section 2"
}
]

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.