Setting default in a repeat loop from previous entry

I am repeatedly looping and collecting values. In practice, the first value
for most fields will be the same for subsequent iterations.

Is there a way that the previous entry for each field can become the new
default entry ?

I attach a minimal xls to illustrate this. I put ${breed} in default for
breed - unsurprisingly it does not work as I imagined it might.

Similarly with this form, the animals id is likely to be incremental, so I
could calculate a likely default by adding 1. How can I get that value and
make it the new default?

Thanks for help and patience with a newbie - I promise I am searching for
solutions before I ask here and I am making great progress :slight_smile:

loop-default.xls (28.5 KB)

Hi Steve,

Please see calculation example here: http://xlsform.org/#calculation

The example mention in the link is carrying forward the calculated tip in
note. Hope this helps

Thanks,
Abbas

··· On Friday, June 24, 2016 at 8:02:53 PM UTC+5, steve kemp wrote: > > I am repeatedly looping and collecting values. In practice, the first > value for most fields will be the same for subsequent iterations. > > Is there a way that the previous entry for each field can become the new > default entry ? > > > I attach a minimal xls to illustrate this. I put *${breed}* in default > for breed - unsurprisingly it does not work as I imagined it might. > > Similarly with this form, the animals id is likely to be incremental, so I > could calculate a likely default by adding 1. How can I get that value and > make it the new default? > > Thanks for help and patience with a newbie - I promise I am searching for > solutions before I ask here and I am making great progress :-) >

Thanks

That does work for label, but does not work if I put the variable into the
default field

Is there a way to put a variable into default? This must be a very common
requirement.

Steve

··· On Saturday, June 25, 2016 at 2:44:35 AM UTC+3, abba...@gmail.com wrote: > > Hi Steve, > > Please see calculation example here: http://xlsform.org/#calculation > > The example mention in the link is carrying forward the calculated tip in > note. Hope this helps > > Thanks, > Abbas > > > > On Friday, June 24, 2016 at 8:02:53 PM UTC+5, steve kemp wrote: >> >> I am repeatedly looping and collecting values. In practice, the first >> value for most fields will be the same for subsequent iterations. >> >> Is there a way that the previous entry for each field can become the new >> default entry ? >> >> >> I attach a minimal xls to illustrate this. I put *${breed}* in default >> for breed - unsurprisingly it does not work as I imagined it might. >> >> Similarly with this form, the animals id is likely to be incremental, so >> I could calculate a likely default by adding 1. How can I get that value >> and make it the new default? >> >> Thanks for help and patience with a newbie - I promise I am searching for >> solutions before I ask here and I am making great progress :-) >> >

Could you explain in more what is your end goal - what you are trying to
achieve by putting variable as default in detail?

Thank,
Abbas

··· On Saturday, June 25, 2016 at 12:46:17 PM UTC+5, steve kemp wrote: > > Thanks > > That does work for label, but does not work if I put the variable into the > default field > > Is there a way to put a variable into default? This must be a very > common requirement. > > Steve > > On Saturday, June 25, 2016 at 2:44:35 AM UTC+3, abba...@gmail.com wrote: >> >> Hi Steve, >> >> Please see calculation example here: http://xlsform.org/#calculation >> >> The example mention in the link is carrying forward the calculated tip in >> note. Hope this helps >> >> Thanks, >> Abbas >> >> >> >> On Friday, June 24, 2016 at 8:02:53 PM UTC+5, steve kemp wrote: >>> >>> I am repeatedly looping and collecting values. In practice, the first >>> value for most fields will be the same for subsequent iterations. >>> >>> Is there a way that the previous entry for each field can become the new >>> default entry ? >>> >>> >>> I attach a minimal xls to illustrate this. I put *${breed}* in default >>> for breed - unsurprisingly it does not work as I imagined it might. >>> >>> Similarly with this form, the animals id is likely to be incremental, so >>> I could calculate a likely default by adding 1. How can I get that value >>> and make it the new default? >>> >>> Thanks for help and patience with a newbie - I promise I am searching >>> for solutions before I ask here and I am making great progress :-) >>> >>

The xls i attached was an attempt to explain what I was trying to do.

I am collecting data on animals that will usually come through in batches
with common characteristics. The form repeats collecting data on each. For
example, breed is collected on each. After I have recorded one animal, the
next is very likely to be the same breed and I would like the value entered
on the previous repeat to become the default on the next repeat. This would
dramatically speed-up data entry.

Thanks for your help

Steve

··· On Saturday, June 25, 2016 at 12:07:44 PM UTC+3, abba...@gmail.com wrote: > > Could you explain in more what is your end goal - what you are trying to > achieve by putting variable as default in detail? > > Thank, > Abbas > > On Saturday, June 25, 2016 at 12:46:17 PM UTC+5, steve kemp wrote: >> >> Thanks >> >> That does work for label, but does not work if I put the variable into >> the default field >> >> Is there a way to put a variable into default? This must be a very >> common requirement. >> >> Steve >> >> On Saturday, June 25, 2016 at 2:44:35 AM UTC+3, abba...@gmail.com wrote: >>> >>> Hi Steve, >>> >>> Please see calculation example here: http://xlsform.org/#calculation >>> >>> The example mention in the link is carrying forward the calculated tip >>> in note. Hope this helps >>> >>> Thanks, >>> Abbas >>> >>> >>> >>> On Friday, June 24, 2016 at 8:02:53 PM UTC+5, steve kemp wrote: >>>> >>>> I am repeatedly looping and collecting values. In practice, the first >>>> value for most fields will be the same for subsequent iterations. >>>> >>>> Is there a way that the previous entry for each field can become the >>>> new default entry ? >>>> >>>> >>>> I attach a minimal xls to illustrate this. I put *${breed}* in default >>>> for breed - unsurprisingly it does not work as I imagined it might. >>>> >>>> Similarly with this form, the animals id is likely to be incremental, >>>> so I could calculate a likely default by adding 1. How can I get that value >>>> and make it the new default? >>>> >>>> Thanks for help and patience with a newbie - I promise I am searching >>>> for solutions before I ask here and I am making great progress :-) >>>> >>>

Steve,

I don't think there is an easy and reliable way to forward values like
this. It might seem like you could use a calculate to forward the
value from question 1 to question 2, but any edits you make in
question 2 will likely be overwritten by the values in question 1 when
the form's data model is updated.

Yaw

··· -- Need ODK consultants? Nafundi provides form design, server setup, in-field training, and software development for ODK. Go to https://nafundi.com to get started.

On Sat, Jun 25, 2016 at 2:13 PM, steve kemp skemp255@gmail.com wrote:

The xls i attached was an attempt to explain what I was trying to do.

I am collecting data on animals that will usually come through in batches
with common characteristics. The form repeats collecting data on each. For
example, breed is collected on each. After I have recorded one animal, the
next is very likely to be the same breed and I would like the value entered
on the previous repeat to become the default on the next repeat. This would
dramatically speed-up data entry.

Thanks for your help

Steve

On Saturday, June 25, 2016 at 12:07:44 PM UTC+3, abba...@gmail.com wrote:

Could you explain in more what is your end goal - what you are trying to
achieve by putting variable as default in detail?

Thank,
Abbas

On Saturday, June 25, 2016 at 12:46:17 PM UTC+5, steve kemp wrote:

Thanks

That does work for label, but does not work if I put the variable into
the default field

Is there a way to put a variable into default? This must be a very
common requirement.

Steve

On Saturday, June 25, 2016 at 2:44:35 AM UTC+3, abba...@gmail.com wrote:

Hi Steve,

Please see calculation example here: http://xlsform.org/#calculation

The example mention in the link is carrying forward the calculated tip
in note. Hope this helps

Thanks,
Abbas

On Friday, June 24, 2016 at 8:02:53 PM UTC+5, steve kemp wrote:

I am repeatedly looping and collecting values. In practice, the first
value for most fields will be the same for subsequent iterations.

Is there a way that the previous entry for each field can become the
new default entry ?

I attach a minimal xls to illustrate this. I put ${breed} in default
for breed - unsurprisingly it does not work as I imagined it might.

Similarly with this form, the animals id is likely to be incremental,
so I could calculate a likely default by adding 1. How can I get that value
and make it the new default?

Thanks for help and patience with a newbie - I promise I am searching
for solutions before I ask here and I am making great progress :slight_smile:

--

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.