# Integration of Enketo into ODK Central

**URL:** <https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992>\
**Category:** Development\
**Tags:** enketo, odk-central\
**Created:** [July 12, 2018, 5:59pm UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992 "2018-07-12T17:59:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![martijnr](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/martijnr/32/1614_2.png) [@martijnr](https://forum.getodk.org/u/martijnr)\
**Post date:** [July 12, 2018, 5:59pm UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/1 "2018-07-12T17:59:46Z")

</div>

I'd like to propose and gauge interest in the following 3 types of additional functionality to ODK Central using Enketo's API.

### Viewing/pre-viewing/pdf-ing forms

Various ways to view empty forms as well as records (loaded into a form). For example:

1. A form preview to test form appearance and logic, as used on [https://opendatakit.org/xlsform/](https://opendatakit.org/xlsform/) (using [this API call](https://apidocs.enketo.org/v2#/post-survey-preview))
2. A PDF of an empty form (using [this API call](https://apidocs.enketo.org/v2#/post-survey-view-pdf))
3. A PDF of a record loaded into a form (using [this API call](https://apidocs.enketo.org/v2#/post-instance-view-pdf))
4. Viewing a [record in readonly form](https://forum.getodk.org/t/paper-copy-of-form-ie-enketo-after-collecting-data-with-odk/3968) (using [this API call](https://apidocs.enketo.org/v2#/post-instance-view))

### Editing already submitted data

This is the feature that KoBoToolbox, Ona (and even the old Formhub) are using to edit submitted data in a browser (using [this API call](https://apidocs.enketo.org/v2#/post-instance)). There have been [some expressions of interest](https://forum.getodk.org/t/edit-odk-data-using-enketo-express/4419/2) in this feature (for Aggregate) in this forum. Technically, this requires the ODK Central backend to become able to deal with replacing earlier submissions (using an instanceID -\> deprecatedID swap). This could be done by either maintaining a chain of edits or by removing an older version of a record once an edit has been submitted.

### Collecting data in a browser

This would expose additional use cases/features for collecting data with ODK Central such as:

1. online website-embedded surveys (using [this API call](https://apidocs.enketo.org/v2#/post-survey-iframe))
2. email single-use surveys that have some protection against multiple submissions by the same person (using [this API call](https://apidocs.enketo.org/v2#/post-survey-single-once))
3. online surveys where default values for questions can be dynamically populated (per user if desired)
4. desktop/laptop data collection/entry
5. iOS data collection/entry
6. displaying questions in a flexible grid using the [Grid Theme](https://blog.enketo.org/gorgeous-grid/)

As well as providing an alternative to ODK Collect for

1. Offline-capable, multi-submission surveys done by enumerators (using [this API call](https://apidocs.enketo.org/v2#/post-survey-offline))

If some of these seem interesting to you, please let us know! The feedback can be used for fund-raising and planning.

---

<div class="post-metadata">

**Author:** ![Lloyd\_Banwart](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/lloyd_banwart/32/1773_2.png) [@Lloyd\_Banwart](https://forum.getodk.org/u/Lloyd_Banwart)\
**Post date:** [July 13, 2018, 4:26pm UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/2 "2018-07-13T16:26:04Z")

</div>

Hi @martijnr thanks for this. Being able to test xlsxforms appearance and logic would be great for a lot of reasons; most of all to new form developers. It would have saved me lots of time when I first started learning what different question types, constraints, and relevant statements did.

I also think having an easier mode to collect surveys in the browser would be great. At my organization we use Google Forms or Survey Monkey for this, and frankly, their logic and constraints have a lot to be desired. I'm always left frustrated with how I can add quality control mechanisms or skip pasterns, even in relatively  
basic surveys.

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [July 13, 2018, 7:29pm UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/3 "2018-07-13T19:29:49Z")

</div>

@martijnr Would these features rely on Enketo's hosted service? If so, could we bundle Enketo with Central?

---

<div class="post-metadata">

**Author:** ![martijnr](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/martijnr/32/1614_2.png) [@martijnr](https://forum.getodk.org/u/martijnr)\
**Post date:** [July 13, 2018, 8:07pm UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/4 "2018-07-13T20:07:40Z")

</div>

Good question. That dependency would have been clever! 🙂 But no, it wouldn't rely on a hosted service.

It is best to keep them in separate boxes like Aggregate/Enketo, KoBo/Enketo, Ona/Enketo, so we can use the same loosely-coupled Enketo Express app for all. The link between them is established with 2 config items (API URL and API key).

I haven't yet looked into ODK Central deployment, but I believe it's using docker (which is something I have not used myself). So it could be 'bundled' as an (optional) docker container on the same server or placed on a separate server (KoBo is using docker to deploy Enketo on separate servers). For any serious traffic it would need its own server. The demands on CPU and memory can become fairly high (though odk.enke.to is still running reasonably well on a $5/month DigitalOcean box to my surprise).

Update: It is maybe good to give an idea of the (manual) installation procedure of a production server: [https://blog.enketo.org/install-enketo-production-ubuntu/](https://blog.enketo.org/install-enketo-production-ubuntu/)

---

<div class="post-metadata">

**Author:** ![Xiphware](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/xiphware/32/2587_2.png) [@Xiphware](https://forum.getodk.org/u/Xiphware)\
**Post date:** [July 16, 2018, 11:01pm UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/5 "2018-07-16T23:01:01Z")

</div>

> [@martijnr](#):
>
> A form preview to test form appearance and logic,

FYI I use Enketo extensively for this purpose (from KoboToolbox), basically to test my new forms while I'm writing them. it saves me a **tremendous** amount of time over the alternative of having to export the XForm, import it into my sever, download it onto my device, fire it up, ...

I'd also love to be able to reuse it to generate a PDF version of a completed form, but unfortuantely this is something I have to do offline on my the device, so I'm having to roll-my-own [FYI I actually convert my completed XForm to HTML, and let the device's web viewer do the PDF conversion]. So an open-source, Enketo-based XForm2PDF library would be awesome... hint, hint 🙂

---

<div class="post-metadata">

**Author:** ![dr\_michaelmarks](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/dr_michaelmarks/32/1772_2.png) [@dr\_michaelmarks](https://forum.getodk.org/u/dr_michaelmarks)\
**Post date:** [November 1, 2018, 11:05am UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/6 "2018-11-01T11:05:09Z")

</div>

We have lots and lots of users at LSHTM so here are comments from our perspective:

**Viewing/pre-viewing/pdf-ing forms**  
All four of these would be extremely helpful.  
Specific use cases

1. Form preview very helpful for development

2. PDF versions are very useful when training staff on questions and also for auto-generating a document we can submit to ethics committees who often want to 'see' the data collection form even when it doesnt exist as a paper document (and who couldn't handle looking at an excel)

3. Again PDF records in read-only form would be hugely helpful (can be required in some kinds of study for governance reasons)

**Editing already submitted data**  
This would be valuable.  
_Especially if it did so in a way that maintained an audit trail (i.e so you could see which user edited what field at what time and what the previous values were_ - That would be co-aligned with my request for an[audit trail within collect](https://forum.getodk.org/t/collect-keep-history-of-changes-to-values-in-the-form/15458/11)

**Collecting data in a browser**  
Again this would be very desirable

@chrissyhroberts thoughts wlecomed

---

<div class="post-metadata">

**Author:** ![aurdipas](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/aurdipas/32/1785_2.png) [@aurdipas](https://forum.getodk.org/u/aurdipas)\
**Post date:** [November 1, 2018, 2:05pm UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/7 "2018-11-01T14:05:09Z")

</div>

> [@dr\_michaelmarks](#):
>
> PDF versions are very useful when training staff on questions and also for auto-generating a document we can submit to ethics committees who often want to 'see' the data collection form even when it doesnt exist as a paper document (and who couldn't handle looking at an excel)

Yes very useful for training especially using the guidance\_hint functionality.

---

<div class="post-metadata">

**Author:** ![danbjoseph](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/danbjoseph/32/21901_2.png) [@danbjoseph](https://forum.getodk.org/u/danbjoseph)\
**Post date:** [February 11, 2019, 9:47pm UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/8 "2019-02-11T21:47:13Z")

</div>

Did this progress since these posts?

We are interested in using Enketo for a form preview to test form appearance and logic, for a PDF of an empty form, and for collecting data in a browser (specifically desktop/laptop data collection/entry, and as an alternative to ODK Collect).

---

<div class="post-metadata">

**Author:** ![martijnr](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/martijnr/32/1614_2.png) [@martijnr](https://forum.getodk.org/u/martijnr)\
**Post date:** [February 11, 2019, 11:39pm UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/9 "2019-02-11T23:39:29Z")

</div>

I expect this to be implemented at some point at least before the end of June 2019. Enketo has some funding for it, but under that special project, it has to be implemented by one of the partner organizations of that project. It's under the High Priority column due to the demand for it: [https://github.com/orgs/enketo/projects/2](https://github.com/orgs/enketo/projects/2)

Most of the work requires no knowledge of Enketo code though (just consuming the API as documented here: [https://apidocs.enketo.org/v2](https://apidocs.enketo.org/v2)). So if somebody else wants to take this on, I would highly encourage that (and we can use this special project funding for other tasks).

The only (fairly minor) work required on the Enketo Express side, is tweaking the authentication (unless ODK Central has in the mean time been updated to support the slower handshake-style authentication that Enketo already supports).

---

<div class="post-metadata">

**Author:** ![martijnr](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/martijnr/32/1614_2.png) [@martijnr](https://forum.getodk.org/u/martijnr)\
**Post date:** [June 6, 2019, 10:23pm UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/10 "2019-06-06T22:23:22Z")

</div>

> [@martijnr](#):
>
> before the end of June 2019

before the end of August is the new expectation

---

<div class="post-metadata">

**Author:** ![issa](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/i/87869e/32.png) [@issa](https://forum.getodk.org/u/issa)\
**Post date:** [June 7, 2019, 3:14am UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/11 "2019-06-07T03:14:58Z")

</div>

please do rely on me for this effort!

---

<div class="post-metadata">

**Author:** ![martijnr](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/martijnr/32/1614_2.png) [@martijnr](https://forum.getodk.org/u/martijnr)\
**Post date:** [June 7, 2019, 3:14pm UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/12 "2019-06-07T15:14:34Z")

</div>

They/he/she definitely will. Thank you!

---

<div class="post-metadata">

**Author:** ![dr\_michaelmarks](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/dr_michaelmarks/32/1772_2.png) [@dr\_michaelmarks](https://forum.getodk.org/u/dr_michaelmarks)\
**Post date:** [June 12, 2019, 6:23am UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/13 "2019-06-12T06:23:49Z")

</div>

@martijnr do you know how Enketo will track changes made to instance through the server?

With @ln and @yanokwa we are doing quite a bit of work trying to get a GCP compliant audit trail

> [@Approaches for linking form instance changes to individuals](https://forum.getodk.org/t/approaches-for-linking-form-instance-changes-to-individuals/20189/6):
>
> Agreed that option 2 would be expedient but it's also the least flexible. That is, if it's defined as prompting the user for an alphanumeric value, that's all it can do. It can't collect signatures, identifiers from a fingerprint app, etc. Similarly, once it's decided that it tracks username and comment, that's all it can do. With some of the other options, the form designer could choose to do things like require comments on certain fields. That sounds right. Agreed that the goal is to get a…

At the moment we don't worry about server changes to data (because they aren't possible) but if this functionality became available being able to similarly track changes made via the server interface would be excellent and a huge plus on the GCP side.

---

<div class="post-metadata">

**Author:** ![mathieubossaert](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/mathieubossaert/32/6131_2.png) [@mathieubossaert](https://forum.getodk.org/u/mathieubossaert)\
**Post date:** [June 12, 2019, 6:46am UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/14 "2019-06-12T06:46:59Z")

</div>

Hi to all, I understand from that discussion that you will make ODK Central able to serve collect forms as web forms. Am I wrong ?  
If not this will be a really great new feature !

Mathieu

---

<div class="post-metadata">

**Author:** ![martijnr](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/martijnr/32/1614_2.png) [@martijnr](https://forum.getodk.org/u/martijnr)\
**Post date:** [June 12, 2019, 4:59pm UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/15 "2019-06-12T16:59:26Z")

</div>

> [@dr\_michaelmarks](#):
>
> @martijnr do you know how Enketo will track changes made to instance through the server?

First we'd have add the general audit capabilities to Enketo. I'm open to getting the audit features that ODK Collect has **if we can ensure that (meta)data is compatible when collected by different clients (Collect & Enketo)**. I'm not sure if that is feasible for the complete package of audit events, but for value change logs I imagine it would be since it will be straightforward (not relying on when a field has focus as in the 'question' event). So Enketo may end up with a subset of audit capabilities that ODK Collect has (provided there's funding and developer interest).

Adding the ability to edit already submitted data via Central, could work with whatever audit capability gets added to Enketo, but we'd have to add something to Enketo's edit API endpoint to send the previous audit file with the API call. That is feasible. Once Enketo has the file, loading it would use the same mechanism as loading an unsubmitted draft record (with audit file) from the browser storage.

---

<div class="post-metadata">

**Author:** ![martijnr](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/martijnr/32/1614_2.png) [@martijnr](https://forum.getodk.org/u/martijnr)\
**Post date:** [June 12, 2019, 5:01pm UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/16 "2019-06-12T17:01:08Z")

</div>

> [@mathieubossaert](#):
>
> that you will make ODK Central able to serve collect forms as web forms. Am I wrong ?

Yes, it will allow serving ODK XForms as web forms indeed! (like in Ona and Kobotoolbox)!

---

<div class="post-metadata">

**Author:** ![LN](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ln/32/1605_2.png) [@LN](https://forum.getodk.org/u/LN)\
**Post date:** [June 12, 2019, 10:34pm UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/17 "2019-06-12T22:34:32Z")

</div>

> [@dr\_michaelmarks](#):
>
> if this functionality became available being able to similarly track changes made via the server interface would be excellent

I'm a little late to the party but just described something similar at [Approaches for linking form instance changes to individuals - #22 by LN](https://forum.getodk.org/t/approaches-for-linking-form-instance-changes-to-individuals/20189/22).

> [@martijnr](#):
>
> I'm not sure if that is feasible for the complete package of audit events

That seems totally fine to me. In fact, I imagine that Enketo might also want to introduce event types that don't make sense from a Collect perspective.

What we might want to do sooner than later is add a way for the client audit log to include a user agent identifier (ODK XForms client type, client version, operating system, etc).

---

<div class="post-metadata">

**Author:** ![martijnr](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/martijnr/32/1614_2.png) [@martijnr](https://forum.getodk.org/u/martijnr)\
**Post date:** [June 12, 2019, 10:44pm UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/18 "2019-06-12T22:44:00Z")

</div>

> [@LN](#):
>
> What we might want to do sooner than later is add a way for the client audit log to include a user agent identifier (ODK XForms client, operating system, etc).

Yes, indeed! That would be a good to start early on.

---

<div class="post-metadata">

**Author:** ![issa](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/i/87869e/32.png) [@issa](https://forum.getodk.org/u/issa)\
**Post date:** [June 13, 2019, 1:30am UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/19 "2019-06-13T01:30:26Z")

</div>

since this is a thread about Central after all, i thought i'd chime in and just say that somewhat fine-grained data history (both forms and submissions) and administrative action audit logging are factored into the architecture of Central. i don't think at the interface level it works exactly the way enketo et al do it, but after all it's just architectural foundation right now—exactly what happens upon what action can be decided upon later.

---

<div class="post-metadata">

**Author:** ![mathieubossaert](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/mathieubossaert/32/6131_2.png) [@mathieubossaert](https://forum.getodk.org/u/mathieubossaert)\
**Post date:** [June 13, 2019, 7:37am UTC](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992/20 "2019-06-13T07:37:04Z")

</div>

Thanks @martijnr.  
Such a lot of perspectives ! 😄

[Next page](https://forum.getodk.org/t/integration-of-enketo-into-odk-central/13992.md?page=2)
