# Metadata collection in ODK2

**URL:** <https://forum.odk-x.org/t/metadata-collection-in-odk2/338>\
**Category:** Support\
**Created:** [August 24, 2018, 10:06am UTC](https://forum.odk-x.org/t/metadata-collection-in-odk2/338 "2018-08-24T10:06:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkusSt](https://odkx.b-cdn.net/letter_avatar_proxy/v4/letter/m/898d66/32.png) [@MarkusSt](https://forum.odk-x.org/u/MarkusSt)\
**Post date:** [August 24, 2018, 10:06am UTC](https://forum.odk-x.org/t/metadata-collection-in-odk2/338/1 "2018-08-24T10:06:32Z")

</div>

Hi there,

I am currently trying out ODK2 to test its capabilities compared to ODK and other similar data collection tools.  
While going trough the documentation of ODK2 I noticed that **metadata collection** , which is done in ODK by adding special question types in the XLSForm-file, is not mentioned.  
Regardless, I tried to add those question types to an ODK2 application (in case it was simply neglected in the documentation), but the .xlsx file gets rejected by the XLSX Converter due to unknown question types.  
So my question is: Is metadata collection simply not a feature of ODK2 (yet?)? Or is it possible to build the necessary prompt types as custom prompts, using HTML/JS?

Thanks a lot,  
Markus

---

<div class="post-metadata">

**Author:** ![clarice\_larson](https://odkx.b-cdn.net/user_avatar/forum.odk-x.org/clarice_larson/32/293_2.png) [@clarice\_larson](https://forum.odk-x.org/u/clarice_larson)\
**Post date:** [August 29, 2018, 3:06am UTC](https://forum.odk-x.org/t/metadata-collection-in-odk2/338/2 "2018-08-29T03:06:47Z")

</div>

Hi Markus,

What metadata fields are you interested in from ODK Collect? ODK 2 has metadata fields provided with each row. The fields with a brief description are below.

\_id - an id for the row  
\_form\_id - the id of the Survey form used to generate the row  
\_locale - the locale used to create the row   
\_savepoint\_type - a value for whether the information in the row has been finalized  
\_savepoint\_timestamp - a timestamp indicating when the row was saved last   
\_savepoint\_creator - the user who saved the row  
\_row\_etag - an id that identifies a particular revision of a row within a table.   
\_default\_access - related to [data permissions](https://docs.opendatakit.org/odk2/data-permission-filters/?highlight=filter), specifies the access to the row that is granted to all unprivileged user  
\_owner - related to [data permissions](https://docs.opendatakit.org/odk2/data-permission-filters/?highlight=filter), the owner of this row   
\_group\_read\_only - related to [data permissions](https://docs.opendatakit.org/odk2/data-permission-filters/?highlight=filter), specify a user group that is granted read access on the row  
\_group\_modify - related to [data permissions](https://docs.opendatakit.org/odk2/data-permission-filters/?highlight=filter), specify a user group that is granted modify access on the row   
\_group\_privileged - related to [data permissions](https://docs.opendatakit.org/odk2/data-permission-filters/?highlight=filter), specify a user group that is granted privileged access on the row

Do any of these fields sound like what you would need? If not, you can always create a custom prompt type.

Clarice

---

<div class="post-metadata">

**Author:** ![MarkusSt](https://odkx.b-cdn.net/letter_avatar_proxy/v4/letter/m/898d66/32.png) [@MarkusSt](https://forum.odk-x.org/u/MarkusSt)\
**Post date:** [August 30, 2018, 10:24am UTC](https://forum.odk-x.org/t/metadata-collection-in-odk2/338/3 "2018-08-30T10:24:37Z")

</div>

Hi Clarice,

so these are collected automatically, without having to state it explicitly in the XLSForm-File?  
That’s fantastic!  
The one’s that I’m missing (coming from ODK1 and similar projects) are the collection-device related fields like Device-ID (IMEI), Subscriber-ID (IMSI) or SIM serial.  
I don’t need them in a specific project, it just seems odd to me that the respective question-types from ODK1 are not support in ODK2 anymore.  
If they can be recreated using custom prompts, though, I’m perfectly fine with that. 🙂

Markus

---

<div class="post-metadata">

**Author:** ![clarice\_larson](https://odkx.b-cdn.net/user_avatar/forum.odk-x.org/clarice_larson/32/293_2.png) [@clarice\_larson](https://forum.odk-x.org/u/clarice_larson)\
**Post date:** [August 31, 2018, 8:04pm UTC](https://forum.odk-x.org/t/metadata-collection-in-odk2/338/4 "2018-08-31T20:04:33Z")

</div>

Hi Markus,

Yes, these fields are collected automatically. I’m glad that they will be useful, but feel free to experiment with the tools to make sure that the fields meet your needs. For most cases, we have typically thought that the problem of knowing which device was responsible for making changes to a row would be solved by using user permissions. We feel that this approach is inline with Android best practices ([一意の識別子に関するベスト プラクティス &nbsp;|&nbsp; Android Developers](https://developer.android.com/training/articles/user-data-ids), [Android Developers Blog: Identifying App Installations](https://android-developers.googleblog.com/2011/03/identifying-app-installations.html)). However, if this is a feature that you would like, feel free to create a feature request. We are open to adding features that the community finds useful.

Clarice

---

<div class="post-metadata">

**Author:** ![MarkusSt](https://odkx.b-cdn.net/letter_avatar_proxy/v4/letter/m/898d66/32.png) [@MarkusSt](https://forum.odk-x.org/u/MarkusSt)\
**Post date:** [September 1, 2018, 7:54am UTC](https://forum.odk-x.org/t/metadata-collection-in-odk2/338/5 "2018-09-01T07:54:08Z")

</div>

Thank you very much for this explanation!  
This reasoning definitely makes sense and should indeed cover most cases.

Markus
