XLSForm / pyxform

A Python package to create XForms for ODK Collect.
BSD 2-Clause "Simplified" License
80 stars 136 forks source link

Preserve order of columns when building secondary instance #602

Closed lognaturel closed 10 months ago

lognaturel commented 2 years ago

Software and hardware versions

pyxform v1.9.0 and prior

Problem description

Columns are alphabetized by header name when a secondary instance is built. This hasn't been noticeable since secondary instances haven't been exposed anywhere without each value being pulled out explicitly. The new map appearance on select_ones shows additional properties in order from the XForm and it would be ideal for that order to reflect user intent.

Steps to reproduce the problem

Convert a form with a select that becomes a secondary instance (e.g. this one). Notice that in the XForm, node names are ordered alphabetically.

Expected behavior

The order of columns is preserved.

Other information

Tangentially related to https://github.com/XLSForm/pyxform/issues/590