Auto select from select_one list under repeat

Aim is item will be selected automatically when Add button clicked. please
find the attachment.

It work ok but suddenly returns error below. not it works in first item
only. Does any one know how to solve this issue.

"Error occurred trying to evaluate: 5431590, message: i.sortDocumentOrder
is not a function"

test1.xlsx (11 KB)

This group is for questions about ODK Collect, ODK Aggregate, and the other
ODK tools available here:

I believe this is a question about Enketo or some other web-based tool.
Please contact those developers for assistance.

(Your form works fine on ODK Collect)

··· On Fri, May 22, 2015 at 3:49 AM, Enkhbayar S wrote:

Aim is item will be selected automatically when Add button clicked. please
find the attachment.

It work ok but suddenly returns error below. not it works in first item
only. Does any one know how to solve this issue.

"Error occurred trying to evaluate: 5431590, message: i.sortDocumentOrder
is not a function"

--

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.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Yes, I also believe this is an Enketo bug. It is filed
here: https://github.com/enketo/enketo-core/issues/195. Generally,
calculations on input fields have very limited support in Enketo. It is not
a high priority to fix this, until a sponsor pushes for it.

Good to know this is now supported in ODK Collect though (Mitch, this
https://code.google.com/p/opendatakit/issues/detail?id=1030&thanks=1030&ts=1404756307
can be closed perhaps?).

Enketo forum is here: https://groups.google.com/forum/#!forum/enketo-users

Cheers,
Martijn

··· On Friday, May 22, 2015 at 7:40:25 AM UTC-6, Mitch Sundt wrote: > > This group is for questions about ODK Collect, ODK Aggregate, and the > other ODK tools available here: > http://opendatakit.org/downloads/ > > I believe this is a question about Enketo or some other web-based tool. > Please contact those developers for assistance. > > (Your form works fine on ODK Collect) > > On Fri, May 22, 2015 at 3:49 AM, Enkhbayar S <s.enk...@gmail.com > wrote: > >> Aim is item will be selected automatically when Add button clicked. >> please find the attachment. >> >> It work ok but suddenly returns error below. not it works in first item >> only. Does any one know how to solve this issue. >> >> "Error occurred trying to evaluate: 5431590, message: i.sortDocumentOrder >> is not a function" >> >> -- >> -- >> Post: opend...@googlegroups.com >> Unsubscribe: opendatakit...@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...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com >

--

Revolutionizing data collection since 2012.

Enketo https://enketo.org/ | LinkedIn
http://www.linkedin.com/company/enketo-llc | GitHub
https://github.com/enketo | Twitter https://twitter.com/enketo
| Blog http://blog.enketo.org/

Hi Mitch,

Thanks for response, it doesn't work properly on ODK Collect, it skips the
list and when I tried go back to the list, returns the error msg
"java.lang.Integer cannot be cast to org.javarosa.core.model.data.
helper.Selection".

do you know what is the reason?
thanks,
Enkhbayar

··· On Friday, May 22, 2015 at 4:40:25 PM UTC+3, Mitch Sundt wrote: > > This group is for questions about ODK Collect, ODK Aggregate, and the > other ODK tools available here: > http://opendatakit.org/downloads/ > > I believe this is a question about Enketo or some other web-based tool. > Please contact those developers for assistance. > > (Your form works fine on ODK Collect) > > On Fri, May 22, 2015 at 3:49 AM, Enkhbayar S <s.enk...@gmail.com > wrote: > >> Aim is item will be selected automatically when Add button clicked. >> please find the attachment. >> >> It work ok but suddenly returns error below. not it works in first item >> only. Does any one know how to solve this issue. >> >> "Error occurred trying to evaluate: 5431590, message: i.sortDocumentOrder >> is not a function" >> >> -- >> -- >> Post: opend...@googlegroups.com >> Unsubscribe: opendatakit...@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...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com >

Hi Enkhbayar,

Apologies, the lack of calculation support in Enketo (and ODK Collect
afaik) refers to a select_one with appearance="minimal".

You form ran into a different little bug, which is now fixed. Live here -->
https://jlzg4-0.enketo.org/webform (temporary link). Clever form!

If you find further Enketo bugs, please use the Enketo forum
https://groups.google.com/forum/#!forum/enketo-users.

Cheers,
Martijn

··· On Friday, May 22, 2015 at 4:22:16 PM UTC-6, Martijn van de Rijdt wrote: > > Yes, I also believe this is an Enketo bug. It is filed here: > https://github.com/enketo/enketo-core/issues/195. Generally, calculations > on input fields have very limited support in Enketo. It is not a high > priority to fix this, until a sponsor pushes for it. > > Good to know this is now supported in ODK Collect though (Mitch, this > > can be closed perhaps?). > > Enketo forum is here: https://groups.google.com/forum/#!forum/enketo-users > > Cheers, > Martijn > > On Friday, May 22, 2015 at 7:40:25 AM UTC-6, Mitch Sundt wrote: >> >> This group is for questions about ODK Collect, ODK Aggregate, and the >> other ODK tools available here: >> http://opendatakit.org/downloads/ >> >> I believe this is a question about Enketo or some other web-based tool. >> Please contact those developers for assistance. >> >> (Your form works fine on ODK Collect) >> >> On Fri, May 22, 2015 at 3:49 AM, Enkhbayar S wrote: >> >>> Aim is item will be selected automatically when Add button clicked. >>> please find the attachment. >>> >>> It work ok but suddenly returns error below. not it works in first item >>> only. Does any one know how to solve this issue. >>> >>> "Error occurred trying to evaluate: 5431590, message: >>> i.sortDocumentOrder is not a function" >>> >>> -- >>> -- >>> Post: opend...@googlegroups.com >>> Unsubscribe: opendatakit...@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...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >> >> -- >> Mitch Sundt >> Software Engineer >> University of Washington >> mitche...@gmail.com >> > > -- > *Revolutionizing data collection since 2012.* > > Enketo | LinkedIn > | GitHub > | Twitter > | Blog >

--

Revolutionizing data collection since 2012.

Enketo https://enketo.org/ | LinkedIn
http://www.linkedin.com/company/enketo-llc | GitHub
https://github.com/enketo | Twitter https://twitter.com/enketo
| Blog http://blog.enketo.org/

This would indicate a datatype mismatch.

select and select-multiple fields always store string values.

While your choice name in the spreadsheet looks like an integer value (1,
2, etc), it is actually stored and processed as a string value "1", "2",
etc.

position(..) returns an integer value (1, 2, etc.).

The problem comes when assigning the integer value into the string-valued
select field.

You need to explicitly convert the integer to a string. See "convert to
string" here: https://opendatakit.org/help/form-design/binding/

e.g.,

string(position(..))

should work.

··· On Mon, Jul 13, 2015 at 3:03 AM, Enkhbayar S wrote:

Hi Mitch,

Thanks for response, it doesn't work properly on ODK Collect, it skips the
list and when I tried go back to the list, returns the error msg
"java.lang.Integer cannot be cast to org.javarosa.core.model.data.
helper.Selection".

do you know what is the reason?
thanks,
Enkhbayar

On Friday, May 22, 2015 at 4:40:25 PM UTC+3, Mitch Sundt wrote:

This group is for questions about ODK Collect, ODK Aggregate, and the
other ODK tools available here:
http://opendatakit.org/downloads/

I believe this is a question about Enketo or some other web-based tool.
Please contact those developers for assistance.

(Your form works fine on ODK Collect)

On Fri, May 22, 2015 at 3:49 AM, Enkhbayar S s.enk...@gmail.com wrote:

Aim is item will be selected automatically when Add button clicked.
please find the attachment.

It work ok but suddenly returns error below. not it works in first item
only. Does any one know how to solve this issue.

"Error occurred trying to evaluate: 5431590, message:
i.sortDocumentOrder is not a function"

--

Post: opend...@googlegroups.com
Unsubscribe: opendatakit...@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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Mitch Sundt
Software Engineer
University of Washington
mitche...@gmail.com

--

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.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com

Perfect, thanks a lot Mitch

··· On Monday, July 13, 2015 at 8:26:17 PM UTC+3, Mitch Sundt wrote: > > This would indicate a datatype mismatch. > > select and select-multiple fields always store string values. > > While your choice name in the spreadsheet looks like an integer value (1, > 2, etc), it is actually stored and processed as a string value "1", "2", > etc. > > position(..) returns an integer value (1, 2, etc.). > > The problem comes when assigning the integer value into the string-valued > select field. > > You need to explicitly convert the integer to a string. See "convert to > string" here: https://opendatakit.org/help/form-design/binding/ > > e.g., > > string(position(..)) > > should work. > > On Mon, Jul 13, 2015 at 3:03 AM, Enkhbayar S <s.enk...@gmail.com > wrote: > >> Hi Mitch, >> >> Thanks for response, it doesn't work properly on ODK Collect, it skips >> the list and when I tried go back to the list, returns the error msg >> "java.lang.Integer cannot be cast to org.javarosa.core.model.data. >> helper.Selection". >> >> do you know what is the reason? >> thanks, >> Enkhbayar >> >> On Friday, May 22, 2015 at 4:40:25 PM UTC+3, Mitch Sundt wrote: >>> >>> This group is for questions about ODK Collect, ODK Aggregate, and the >>> other ODK tools available here: >>> http://opendatakit.org/downloads/ >>> >>> I believe this is a question about Enketo or some other web-based tool. >>> Please contact those developers for assistance. >>> >>> (Your form works fine on ODK Collect) >>> >>> On Fri, May 22, 2015 at 3:49 AM, Enkhbayar S wrote: >>> >>>> Aim is item will be selected automatically when Add button clicked. >>>> please find the attachment. >>>> >>>> It work ok but suddenly returns error below. not it works in first item >>>> only. Does any one know how to solve this issue. >>>> >>>> "Error occurred trying to evaluate: 5431590, message: >>>> i.sortDocumentOrder is not a function" >>>> >>>> -- >>>> -- >>>> Post: opend...@googlegroups.com >>>> Unsubscribe: opendatakit...@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...@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >>> >>> -- >>> Mitch Sundt >>> Software Engineer >>> University of Washington >>> mitche...@gmail.com >>> >> -- >> -- >> Post: opend...@googlegroups.com >> Unsubscribe: opendatakit...@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...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com >