Additional fields in the Metadata

Besides deviceID, *startTime *and endTime tags, how can i add
additional fields in the Metadata as part of form submission ? I would for
example want to include the *version *and *formId *tags and bind them to
the data provided from the downloaded xform that contains the corresponding
tags. Any help would be appreciated.

1 Like

The value of the version and formId are not accessible via any Javarosa
functions.

Note that these are automatically inserted into the submission whenever it
is saved, but are stored as attributes (version, id, respectively) of the
top-level XML element. So they are always present and tracked, but just
not as accessible form fields.

Within ODK Aggregate, if you click 'Display metadata', the version is
present as one of the metadata columns (as is the unique instanceID of that
data record).

Mitch

ยทยทยท On Tue, Jan 29, 2013 at 11:00 AM, Lee Mungai wrote:

Besides deviceID, *startTime *and endTime tags, how can i add
additional fields in the Metadata as part of form submission ? I would for
example want to include the *version *and *formId *tags and bind them to
the data provided from the downloaded xform that contains the corresponding
tags. Any help would be appreciated.

--
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/groups/opt_out.

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

So currently there isnt any way of adding additional metadata fields
besides the pre-defined ones? Would it be possible during form submission
to either POST some Name-Value pairs or even include an additional xml file
that would have additional custom metadata fields?

ยทยทยท On Tuesday, January 29, 2013 10:19:22 PM UTC+3, Mitch wrote: > > The value of the version and formId are not accessible via any Javarosa > functions. > > Note that these are automatically inserted into the submission whenever it > is saved, but are stored as attributes (version, id, respectively) of the > top-level XML element. So they are always present and tracked, but just > not as accessible form fields. > > Within ODK Aggregate, if you click 'Display metadata', the version is > present as one of the metadata columns (as is the unique instanceID of that > data record). > > Mitch > > On Tue, Jan 29, 2013 at 11:00 AM, Lee Mungai <lee.m...@gmail.com wrote: > >> Besides *deviceID*, *startTime *and *endTime* tags, how can i add >> additional fields in the Metadata as part of form submission ? I would for >> example want to include the *version *and *formId *tags and bind them to >> the data provided from the downloaded xform that contains the corresponding >> tags. Any help would be appreciated. >> >> -- >> 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/groups/opt_out. >> >> >> > > > > -- > Mitch Sundt > Software Engineer > University of Washington > mitche...@gmail.com

For metadata, you can use any of the predefined properties that can be
inserted into the form ( http://opendatakit.org/help/form-design/examples/
-- At the bottom of the page). And you can define any number of fields in a
form that have no question (with XLSForm, this may require hand-editing the
XForm .xml file after it is generated to remove the prompt). For example,
the instanceID field is a calculated field that has no user prompt (
http://opendatakit.org/help/form-design/ ).

Only the value and the top-level 'version' attribute
are specially treated and elevated to metadata status within ODK
Aggregate. The other metadata is needed for ODK Aggregate operations
(e.g., tracking what submissions still need to be published, whether or not
a submission is ready for publishing (marked as complete), and who
initially created and last modified a record, and the times of those
changes (useful for DB admins when recovering from database crashes or
restoring to a point prior to catastrophic human error in DB admin)).

Any other fields you insert would just appear as another column of data
from the form. By convention, we think of anything within a top-level
block as being metadata, but it is only a naming convention.

Mitch

ยทยทยท On Wed, Jan 30, 2013 at 4:58 PM, Lee Mungai wrote:

So currently there isnt any way of adding additional metadata fields
besides the pre-defined ones? Would it be possible during form submission
to either POST some Name-Value pairs or even include an additional xml file
that would have additional custom metadata fields?

On Tuesday, January 29, 2013 10:19:22 PM UTC+3, Mitch wrote:

The value of the version and formId are not accessible via any Javarosa
functions.

Note that these are automatically inserted into the submission whenever
it is saved, but are stored as attributes (version, id, respectively) of
the top-level XML element. So they are always present and tracked, but
just not as accessible form fields.

Within ODK Aggregate, if you click 'Display metadata', the version is
present as one of the metadata columns (as is the unique instanceID of that
data record).

Mitch

On Tue, Jan 29, 2013 at 11:00 AM, Lee Mungai lee.m...@gmail.com wrote:

Besides deviceID, *startTime *and endTime tags, how can i add
additional fields in the Metadata as part of form submission ? I would for
example want to include the *version *and *formId *tags and bind them
to the data provided from the downloaded xform that contains the
corresponding tags. Any help would be appreciated.

--
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/**groups/opt_outhttps://groups.google.com/groups/opt_out
.

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

--
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/groups/opt_out.

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