Default value without showing question

Using Collect, I am trying to get a default value into an instance file
from XLSForm without the user seeing the value. Put another way, I want to
be able to specify a value via XLSForm that appears in every instance file.

A natural way to try this would be to specify a default value and indicate
that the question isn't relevant (thus hiding it from the user), but of
course this doesn't work because if it isn't relevant it doesn't appear in
the instance file.

Is there another way to do this? I'd like to use the string for processing
down my pipeline. It doesn't need to be able to reference other form data
or anything tricky, it just needs to appear in the instance file.

Hi Sam,

Use a question of type calculate with the magic string in default.
What you put as the calculation is up to you.

type:calculate
name: my_name
label: my_label
default: my_processing_string
calculation: today()

Relatedly, you can add attributes to various nodes by using the
instance::my_attribute, bind::my_attribute, and body::my_attribute.

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, Aug 20, 2016 at 3:55 PM, Sam Sudar sudar.sam@gmail.com wrote:

Using Collect, I am trying to get a default value into an instance file from
XLSForm without the user seeing the value. Put another way, I want to be
able to specify a value via XLSForm that appears in every instance file.

A natural way to try this would be to specify a default value and indicate
that the question isn't relevant (thus hiding it from the user), but of
course this doesn't work because if it isn't relevant it doesn't appear in
the instance file.

Is there another way to do this? I'd like to use the string for processing
down my pipeline. It doesn't need to be able to reference other form data or
anything tricky, it just needs to appear in the instance file.

--

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.