Collect: Use of current() in a choice filter

ODK Collect v1.17 will be coming out on September 23rd and will include the following warning message in preparation for an upcoming breaking change:

This question will not be compatible with future versions of ODK Collect because it uses current() in a choice filter.

This message will pop up over specific select one or select multiple questions that use relative expressions with current() in choice filters. The message will pop up every time the question is shown. It will affect roughly 1% of forms that use choice filters across all Collect installs. Most forms do not use choice filters so only a small proportion of all Collect users will be affected.

If you use current() in a choice filter and do not take action, your form will not work in Collect v1.18 (planned for late October)

If, and only if, your form has current() in a choice filter, here are the steps you need to take:

  1. Turn off auto update for Collect as soon as you can. To turn off auto updates for Collect, go to Collect's Play Store page by clicking this link from a device or searching for "ODK Collect". From there, tap on the three dots in the upper right hand corner of the screen. Uncheck "Enable auto updates." Optionally, you may also want to manually install Collect v1.16.4 to prevent the dialog from being shown on each form filling. There is documentation on how to manually install an earlier version.

  2. After Collect v1.18 has been released and you are ready to update to it, change your form(s) so that current() calls in choice filters are replaced by current()/../. You will be able to make this change, update the form version, and upload it to Aggregate with the same form_id. Data collectors will need to update the form from Get Blank Form and then will be able to continue collecting data seamlessly.

Why we are making this breaking change
This change is to fix a long-standing bug to ensure compatibility across ODK clients and to make it easier to use relative expressions to refer to values in repeats. Read more about the planned change here.

This timeline won’t work for me
We recognize that it may be difficult to communicate this to all data collectors so there will be at least 1 month before the change happens.

If you are affected by this, please comment below letting us know the size of your campaign and whether you are having any problems taking action. We will adjust timelines accordingly.

2 Likes

Thank you for fixing bug. My county level survey starts on October 10, and I think I will use the older version of the form to avoid toast from enumerators. I'm also using current () in my two surveys which is currently going on.

1 Like

That sounds great, @Odil, and is exactly what I would do.

Do you remember what led you to use this technique? Did you see a particular forum post or other resource that gave you the idea? Identifying those sources may help us make sure everyone affected gets the needed information. Thanks!

Dear @LN, When current()/../ didn't work for my cascade select inside a repeat form I found this bug. I don't exactly remember where did I found this, but there are posts like this also available.
In this post Meletis also mentions that he used current() successfully.

1 Like

After Collect v1.18 has been released and you are ready to update to it, change your form(s) so that current() calls in choice filters are replaced by current()/../. You will be able to make this change, update the form version, and upload it to Aggregate with the same form_id. Data collectors will need to update the form from Get Blank Form and then will be able to continue collecting data seamlessly.

I have a question about this. Does this mean that current tables will NOT get overwritten when the form is republished with the change?

That is correct, previously-collected data will NOT be affected. You can read more about what kinds of form updates are allowed while maintaining existing data in the documentation.

A post was split to a new topic: Current() in a choice filter doesn't work