# "start" & "end" XLSForm Meta Fields returns same value

**URL:** <https://forum.communityhealthtoolkit.org/t/start-end-xlsform-meta-fields-returns-same-value/3416>\
**Category:** Technical Support\
**Tags:** forms\
**Created:** [March 26, 2024, 1:41pm UTC](https://forum.communityhealthtoolkit.org/t/start-end-xlsform-meta-fields-returns-same-value/3416 "2024-03-26T13:41:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anro](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/anro/32/2145_2.png) [@Anro](https://forum.communityhealthtoolkit.org/u/Anro)\
**Post date:** [March 26, 2024, 1:41pm UTC](https://forum.communityhealthtoolkit.org/t/start-end-xlsform-meta-fields-returns-same-value/3416/1 "2024-03-26T13:41:54Z")

</div>

Per the [this](https://docs.communityhealthtoolkit.org/apps/reference/forms/app/#supported-xlsform-meta-fields) CHT documentation, we hoped to calculate the duration a form takes to complete.

| element | description |
| --- | --- |
| start | A timestamp of when the form entry was started, which occurs when the form is fully loaded. |
| end | A timestamp of when the form entry ended, which is when the user hits the Submit button. |

However when implemented on a contact form, in our case a household, they seems to capture the same value - when the form was initially opened.

 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/7/79e1e30b7689c4267fcf377ac848c7dbb510388e.png)  
 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/5/5ff5fd7d2e6376a51a3bb11786b4d3b0db9f20e4.png)

We can probably use the `"reported_date": 1711459816096,` (which resolves to Tuesday, March 26, 2024 3:30:16.096 PM [GMT+02:00](https://www.epochconverter.com/timezones?q=1711459816096)) as a fallback, but hoped to use these built in questions.

Are we perhaps following an incorrect approach?

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [March 27, 2024, 8:23pm UTC](https://forum.communityhealthtoolkit.org/t/start-end-xlsform-meta-fields-returns-same-value/3416/2 "2024-03-27T20:23:40Z")

</div>

I know anytime I see a post from you about form stuff I am in for some interesting debugging… 😅

Once again, you appear to be running into an unintended bug! I have logged an issue with more details:

> <https://github.com/medic/cht-core/issues/8974>
>
> \*\*Describe the bug\*\*
> CHT forms support several \[meta fields\](https://docs.commu…nityhealthtoolkit.org/apps/reference/forms/app/#supported-xlsform-meta-fields) including \`start\` and \`end\` that are supposed to record the exact time the form began and the form ended.
> 
> Unfortunately, the \`end\` value is always just recorded as (almost) the exact same value as the \`start\` regardless of how long the user takes to fill out the form.
> 
> \*\*To Reproduce\*\*
> Create a form that contains:
> 
> | type | name |
> | --- | --- |
> | start | start |
> | end | end |
> 
> 1. Begin the form
> 2. Wait a bit of time (at least a few seconds)
> 3. Submit the form
> 4. See that the different between \`start\` and \`end\` do not match the time waiting before submitting the form.
> 
> \*\*Expected behavior\*\*
> The \`end\` value should contain the time that the form was submitted.
> 
> \*\*Additional context\*\*
> Originally reported \[on the forum\](https://forum.communityhealthtoolkit.org/t/start-end-xlsform-meta-fields-returns-same-value/3416).
> 
> It appears this is a regression that happened as a result of the \[Enekto Uplift\](https://github.com/medic/cht-core/issues/6345) in \`4.0.0\`. I tested and confirmed everything works as expected in \`3.17.2\`, but it is broken in \`4.0.0\`.
> 
> Debugging through the Enekto code flow, it appears the \`start\` and \`end\` values \[are preloaded correctly\](https://github.com/enketo/enketo/blob/37a7af1886743c7e20ddcb9f3b0f8708d184cd88/packages/enketo-core/src/js/preload.js#L75), but the \`BeforeSave\` event is never triggered for the form.

As always, thank you so much for reporting this! It is super helpful to have these detained descriptions of things that are not working like you expect.

---

<div class="post-metadata">

**Author:** ![Anro](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/anro/32/2145_2.png) [@Anro](https://forum.communityhealthtoolkit.org/u/Anro)\
**Post date:** [March 28, 2024, 10:24am UTC](https://forum.communityhealthtoolkit.org/t/start-end-xlsform-meta-fields-returns-same-value/3416/3 "2024-03-28T10:24:32Z")

</div>

Haha sorry about that 😅… we hope to start being the barer of good news rather than bad in the near future!

Of course, any time, thank you as always for being so attentive in looking into this!  
As noted above, we can get by using the `reported_date` in the interim 🙂 .

---

<div class="post-metadata">

**Author:** ![Anro](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/anro/32/2145_2.png) [@Anro](https://forum.communityhealthtoolkit.org/u/Anro)\
**Post date:** [April 11, 2024, 10:28am UTC](https://forum.communityhealthtoolkit.org/t/start-end-xlsform-meta-fields-returns-same-value/3416/4 "2024-04-11T10:28:27Z")

</div>

During our tests, we’ve noticed that the `reported_date` is only captured upon record creation, and not updated again. While this isn’t a problem, and I’m assuming it’s intended behavior, it does mean that calculating form completion on the “contact edit forms” isn’t really possible.  
Just a heads up 🙂 .

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [April 15, 2024, 10:58am UTC](https://forum.communityhealthtoolkit.org/t/start-end-xlsform-meta-fields-returns-same-value/3416/5 "2024-04-15T10:58:43Z")

</div>

Hi @Anro

This is correct, `reported_date` is not updated when the report is edited.

---

<div class="post-metadata">

**Author:** ![jkuester](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/jkuester/32/806_2.png) [@jkuester](https://forum.communityhealthtoolkit.org/u/jkuester)\
**Post date:** [June 26, 2026, 5:04pm UTC](https://forum.communityhealthtoolkit.org/t/start-end-xlsform-meta-fields-returns-same-value/3416/6 "2026-06-26T17:04:20Z")

</div>

Just wanted to note that the issue with the `end` date on forms has been resolved [in 5.2.0](https://docs.communityhealthtoolkit.org/releases/5_2_0/)! 👍
