Challenges with custom_date

I am having a challenge calling a custom_date (using custom_date_picker.handlebars). The value is posted correctly to the table. However if I just try to validate any other date using this custom_date it indicates that there is no value given. If I go back to the variable in ODK Survey it is showing blank though in tables the actual value is there.
I would appreciate any help from the team.

Hi @cmuchuchuti! The dates may be in different formats so that it causes problems to compare them. I am not sure how you are trying to display in survey but {{data.variable}} where variable is your variable’s name usually works in a note or prompt. I would suggest looking at the data of the two variables you are trying to compare in tables and seeing if they are actually comparable. If not, then you may need to use some of the date functions to extract different pieces (year, month, day) to make variables that can be compared.

1 Like

Thanks @elmps2018 for your response.
Below is an extract from my file

On the note its producing blank even after the date has been captured. However in the tables the date is captured as shown in an extract below.

If I go back to the variable within ODK Survey the field is blank.

I defined my custom_date in prompt_types:


You might need to convert between ODK-X dates, your custom dates, and JavaScript dates. Here are some functions to covert to/from JavaScript dates to ODK-X dates.

1 Like

@cmuchuchuti I can also see that you are referring to q1_date_of_interview in the note but the variable name is q1_date_of_collection (not interview)

@elmps2018 apologies it was just a typo error as I was trying to make it clearer in our discussion but the challenge still remains. The date is not showing in Survey even though in tables it is there.

Thanks @W_Brunette.
I will try to follow the link guide

1 Like

@cmuchuchuti can you share a screenshot or the excel with the typo corrected? {{data.variable}} is the correct way to reference this in a note. Are these on the same screen? It may not be recorded or appear until the next screen, that may be the issue.

Hi @elmps2018. Thanks for the reply.
After @W_Brunette’s response I just went and changed the type column in the prompt_type sheet to date. As showed in the screen shared earlier I had erroneously defined it as string. Now the date is showing.
Thanks a lot.

1 Like