Why are these calculations working in connect and field app, but not webform?
Field app :
Web :
Ok, so the calculations are doing something,.. but theyre not being read the same in the web and field app?
The Survey123 web app is very particular about dates as it only works with decimal-dates.
More details here: https://community.esri.com/t5/arcgis-survey123-blog/dates-and-time-in-survey123/ba-p/895528
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 time | Decimal Date time | |
2 weeks into the future | now() + 14*24*60*60*1000 | date(decimal-date-time(now()) + 14) |
Calculate age from birthday | int((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 lunch | int(${LunchEnd} - ${LunchStart}) div (1000*60) | int((decimal-date-time(${lunchends}) - decimal-date-time(${lunchstarts})) * 24*60) |
15 minutes from now | now() + 15*60*1000 | date-time(decimal-date-time(now()) + 0.0104166675) |