Coding for Survey: orderBy

Hi all,

I'm trying out the App Designer & coding forms with Survey. Doing all right for now, new features are awesome and will really open up a lot of opportunities.

I am struggling right now to use the orderBy with using queries.

I have attache a snapshot of the query tab (and the top of the .csv file). The query itself works, I just can't make the orderBy to work. This is actually the "region.csv" file with a list of countries & region that was included among the examples ("select" form)

My line of thinking right now is that the query has to create an object. I thought at first the name of my object would be "country" as that's the name of the variable I used in the callback.

I tried various combinations such as country, 'country', country.name, country.label, country.name()...

Any hints?

image

You are using a csv query. linked_table queries support the orderBy. If
you were doing a linked_table query, then you would be able to specify a
field in the Survey database to order the results by. With a csv query,
the results are just used to populate choice_items and not stored in the
database. The documentation found at
http://opendatakit.org/use/2_0_tools/odk-application-designer-2-0-rev122/odk-xlsxconverter-2-0-rev122/
also mentions this. If anything is unclear in the documentation, please
let us know.

Clarice

··· On Wed, Sep 3, 2014 at 6:47 PM, wrote:

Hi all,

I'm trying out the App Designer & coding forms with Survey. Doing all
right for now, new features are awesome and will really open up a lot of
opportunities.

I am struggling right now to use the orderBy with using queries.

I have attache a snapshot of the query tab (and the top of the .csv file).
The query itself works, I just can't make the orderBy to work. This is
actually the "region.csv" file with a list of countries & region that was
included among the examples ("select" form)

My line of thinking right now is that the query has to create an object. I
thought at first the name of my object would be "country" as that's the
name of the variable I used in the callback.

I tried various combinations such as country, 'country', country.name,
country.label, country.name()...

Any hints?

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


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

No it's pretty clear, I just read that it was indeed a linked_table feature but somehow didn't really register it in my mind.

For anyone else interested though, I found a quick fix to that: I just re-ordered the list by alphabetical order in Excel, based on country name, instead of by country name but groupe by continent.

It doesn't change the final result for the selection of the continent because it takes only unique values anyways.