Assigning a "dynamic" default value to a text-type question

I'm trying to assign a "dynamic" default value to a text-type question. All the tutorials describe how I can add it as a fixed value, i.e. (4 or 5). What if I want to add it from a value that the user enter.

For example, I want to ask about the family size using text (string) question type, then I want to use that entered value as a default value in the next questions. Is that possible?

I've tried to put ${family-size} in the "default" column, but it appears as it is"${family-size}" in the textbox!

Anyone can help me is this?

You can't do this with ODK, and it's probably illegal in terms of the
underlying XForm specification. Not being daunted by specifications or
illegality, we did implement this kind of functionality in SurveyCTO -- but
it is not without limitations. Basically, there is always a question of
when the field's default value should be set and when the user should then
have complete control over the field. In SurveyCTO, we implemented
"calculated defaults" as calculating the moment a field is first displayed
to the user (which might be when the user swipes to it, or it might be when
the user switches into the Go To Prompt UI); after that point, the user has
complete control and the calculated default is never again set. There are
cases where you might prefer behavior to be otherwise, but this is the
behavior that we settled upon as seeming most logical.

If you're customizing the ODK sources, you could implement something
similar, crafting the logic to meet your particular needs.

Best,

Chris

ยทยทยท --- Christopher Robert Dobility, Inc. (SurveyCTO) http://www.surveycto.com/ http://blog.surveycto.com/

On Tue, May 5, 2015 at 1:03 PM mhdhabboub@gmail.com wrote:

I'm trying to assign a "dynamic" default value to a text-type question.
All the tutorials describe how I can add it as a fixed value, i.e. (4 or
5). What if I want to add it from a value that the user enter.

For example, I want to ask about the family size using text (string)
question type, then I want to use that entered value as a default value in
the next questions. Is that possible?

I've tried to put ${family-size} in the "default" column, but it appears
as it is"${family-size}" in the textbox!

Anyone can help me is this?

--
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/d/optout.