autopopulating date in Survey123 subtracts 1 day

3145
14
Jump to solution
08-19-2019 06:50 AM
JamesKelly4
Occasional Contributor

I am using the pulldata() function in the calculation field to autopopulate several survey questions based on the answer to a question regarding a confirmation number. It works great except for the date field I need populated. It will populate a date, but it is a day earlier than the value provided in the .csv file (confrimations.csv).

Here is the formula I used in the calculation field:

pulldata('confirmations','harv_date','conf', ${conf_no})‍

Here is an example of the confirmations.csv with only 1 row of data.

id,conf,county,harv_date,sex
10168797,14400001,Davidson,09/26/2018,male‍‍

When I enter the above confirmation number, this is how it populates the date.

Any ideas? Survey123 for ArcGISJames TedrickIsmael Chivite#pulldata()‌ 

Tags (2)
0 Kudos
14 Replies
JamesTedrick
Esri Esteemed Contributor

Hi James, 

I would need to see the details of your form - are you using a an if() statement with the pulldata to determine if a value is blank?

The obvious method to catch this would be to place a constraint in the question to check if the value is realistic.

0 Kudos
JamesKelly4
Occasional Contributor

Hi James Tedrick thanks for getting back to me on this. I did the other day think to add a constraint so this shouldn't be an issue as far as the value passing. Is there a way to make the default value be something different than 12/31/1969? No worries if not. This one is low priority for me at this point. Thanks again!

0 Kudos
JamesKelly4
Occasional Contributor

James Tedrick‌ please disregard above question. Brain fart. Obviously I could set default date today() or something like that. What I meant was, is there a way to make it default to blank? Sorry for confusion. Thanks again!

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi James,

Yes, you should be able to use '' as the 'blank':

if(${q1}='yes',today(),'')

JamesKelly4
Occasional Contributor

Ah I did not know about that hack. Thanks so much!

0 Kudos