Autocalculation not working in Web survey123

01-25-2022 07:38 AM
New Contributor III


Why are these calculations working in connect and field app, but not webform?

0 Kudos
3 Replies
New Contributor III

Field app :chelynnes_0-1643127564259.png

Web : 


Ok, so the calculations are doing something,.. but theyre not being read the same in the web and field app?

0 Kudos
Esri Notable Contributor

The Survey123 web app is very particular about dates as it only works with decimal-dates.

More details here:

Looking at your expression, it looks as if you are mixing decimal dates and unix dates. Connect handles it, but the web app gets a different result because it expects you to always use decimal date.

The table below shows the differences with other examples. Both columns will work in Connect and the field app, but only the column on the right will work in the web. Note how decimal-date-time() is used consistently to handle dates in expressions.



 UNIX timeDecimal Date time
2 weeks into the futurenow() + 14*24*60*60*1000date(decimal-date-time(now()) +  14)
Calculate age from birthdayint((today() - ${birth_date}) div (1000*24*60*60* 365.25))

int((decimal-date-time(today()) - decimal-date-time(${birth_date})) div 365.25)

Minutes spent for lunchint(${LunchEnd} - ${LunchStart}) div (1000*60)

int((decimal-date-time(${lunchends}) - decimal-date-time(${lunchstarts})) * 24*60)

15 minutes from nownow() + 15*60*1000

date-time(decimal-date-time(now()) +  0.0104166675)

0 Kudos
New Contributor III
I've seen this chart, but I'll have to do more testing on the formula.
0 Kudos