Cannot retrieve date from entity list

HI all,

I am struggling with a weird problem. I am trying to retrieve a date from my entity list with the following calculation:

instance('monitoring_trees')/root/item[name=${site_selection_monitoring}]/planting_date

The planting date has this format in my entity list: 2021-11-23

For some reason, the variable (name) remains empty. This is strange because I can retrieve other items from this entity list without issues (for example tree species or contract number). So this works:

instance('monitoring_trees')/root/item[name=${site_selection_monitoring}]/contract_number

But this not:

instance('monitoring_trees')/root/item[name=${site_selection_monitoring}]/planting_date

Any idea what can be the reason? Is the formatting an issue? As far as I know, all is text in the entity list. The strange thing is that it worked in the past, but not anymore. I also checked the entity list to see if the issue can be found there. But nothing found. Maybe someone can clarify this issue or provide a workaround for this...? Thanks!!

Hi @Edmonds, are you manipulating entities offline or online in your form? e.g., is it an entity you may have updated offline?

I am asking as I observed the following behaviour when using ODKCollect offline a few days ago in a form updating entity properties (using ODK central 2024.3, not sure about ODKCollect - I think 2024.3 as well and not the latest 2025.1 beta as I upgraded since then):

  • retrieving an entity property is_drug using instance('treatments')/root/.../is_drug in a calculated variable
  • using the calculated variable as a skip logic for follow-up questions enabling updating some entity properties
  • saving the modified entity properties
  • it worked well first time, but if I tried to update again the same entity without syncing with the server my follow-up questions had disappeared for the specific entity that was modified offline (while these follow-up questions appeared on all other entities in the drop-down list)
  • when I checked I saw that the calculated variable indeed remained empty as in your case, and only for this property (label and all updated properties were correctly retrieved)
  • everything worked again as expected as soon as I synced forms with the server

As a workaround, I saved the calculated field to overwrite the entity property is_drug (even if it is only read and write without modifications) to ensure it is always available offline and the form is correctly displayed

Do you think it may be your issue?

Hi Thalie,

Thanks for the feedback. I am not sure I understand your issue 100%. For my case:

  1. I update the entity list regularly (from a Postgres database) with the PyODK API (by updating and/or adding entities).
  2. The entity list is also updated (adding entities) through the XLS form (offline)

So the planting data (in my case) is updated by the API and also by the XLS form.

Based on your feedback I will update my entire entity list and see if this resolves the issue. Can it be that the update feeds (planting date) from the XLS form contradict with the feeds (Planting date) from the API...(?). Let's see. I will let you know.

I really feel like I've experienced something like this before but I can't reproduce it in Collect v2024.3.5 with any forms I've tried just now! I know we did have problems with dates from Entity Lists in v2024.1 but those should be fixed.

Can you please verify the Collect version you're using? If it's the latest, I think we'll need a minimal form that reproduces the issue to be able to fix it.

@Thalie this does sound like it could be related and I don't like the sound of it either! If you have a form you could share that reproduces the issue, that'd be much appreciated too.

@LN: I ran some tests with simplified forms and even with the exact same form that previously triggered the issue, but can no longer reproduce the issue using ODK Collect to 2025.1 beta3 and ODK central v2024.3.1 - which is probably good news. That said, I am certain of what I observed, as I repeated the operation 3-4 times on Feb 7th and saw a consistent behavior of the calculate retrieving the entity property being empty when it should have contained a value. Unfortunately, I did not document it at the time—I was on a rush to ensure the form worked properly and assumed I would have time later to investigate.
I did update both ODK Collect to 2025.1 beta3 (on Android 10) and ODK Central from v2024.3 to v2024.3.1 on Feb 10th, so ODKCollect may actually have been v2025.1 beta2 or v2025.1 beta1 (as auto update enabled, although I think I manually updated to beta3)
Also something I forgot to mention, but the field that was to retrieve actually contained an emoji


Will still send you some of the forms I tested by email + entity list just in case

I am using ODK Collect v2024.3.4, so that might be the cause. However, still working with this version, the problem was gone when I did an update of my Entity list (with the API). Now it reads the date again... I will update to v2024.3.5 and let you know in case I experience the issue again. Thanks!

So maybe it is related

@Edmonds, have you checked if the date is displayed again after you update on of your entity offlline?

@LN, I just observed the same behavior with ODK Collect v2025.1.0 Beta 3 (Android 10) and ODK Central v2024.3.1-2 right now using the form attached below (similar structure as other forms previously shared). I now suspect that during my weekend tests, I may have automated syncs in the background, as I did not actively disconnected from the network, which explained why I could not reproduce - sorry I think I was tired and brain not fully operational :see_no_evil:

01_ip_create_facilities.xlsx (672.2 KB)

(1) Screenshot after syncing forms from the server, when updating a facility already registered, the selected facilities with value 0 or 1 in the entity property rct have a follow-up question about their services

(2) Screenshot after having updated the selected entity offline, without sending the submission on the server (tablet is offline) and reopening a new submission, following exactly the same steps - the follow-up question is no longer displayed

(3) Screenshot after having forced the online snyc and reopening a new submission, following exactly the same steps as (1) - the follow-up question is displayed again

As mentioned above the trick for me to make it work is to overwite the rct property when updating entities with the retrieved property value (inserted new row 48 in the form and remove the initial save_to in row 24)
01_ip_create_facilities.xlsx (672.3 KB)

(1) Screenshot after syncing forms from the server, when updating a facility already registered, the selected facilities with value 0 or 1 in the entity property rct have a follow-up question about their services

(2) Screenshot after having updated the selected entity offline, without sending the submission on the server (tablet is offline) and reopening a new submission, following exactly the same steps - the follow-up question is now displayed as expected

Thanks so much for all the details provided, @Thalie and @Edmonds. We think this may have been related to a bug around Entities and relevance. We have a point release v2025.1.1 that should start rolling out soon to address this. Could you please try your forms offline with that update when you get it?

1 Like