Select to view content in your preferred language

pulldata("@layer") Date calculation issue in Survey123 Web App

626
3
Jump to solution
02-09-2024 09:00 AM
hgaignard
Esri Contributor

I’m using pulldata(“layer“) to get 3 attribute values on previous record stored in the survey feature service. This works well for all 3 attribute values in Survey123 Connect and Survey123 Mobile App.

But I encounter an issue with a date calculation in the Survey123 Web App: the previous date is not displayed and the calculation of the duration between it and the current day is not displayed either.

Survey123 Web App.jpg

These date and duration work well in Survey123 Connect and Mobile App :

Survey123 Connect.jpg

I understood that the Survey123 web app only supports decimal time : https://doc.arcgis.com/en/survey123/desktop/create-surveys/decimaldatetime.htm

I also read @IsmaelChivite's article on this subject : https://community.esri.com/t5/arcgis-survey123-blog/dates-and-time-in-survey123/ba-p/895528

2024-02-09_17-10-19.jpg

Please help me 😊

 
 
0 Kudos
1 Solution

Accepted Solutions
hgaignard
Esri Contributor

I succeeded after a lot of tries using the following formula to calculate the date field (previous_date_signalement): date-time(int(${date_pulldata}) div 86400000)

View solution in original post

0 Kudos
3 Replies
ChristopherCounsell
MVP Regular Contributor

decimal-date-time() converts a date object to a decimal date-time number. You're passing a text value from date_pulldata into the decimal-date-time(). 

I think you need to convert the text value to a date before passing it into the decimal-date-time function?

0 Kudos
hgaignard
Esri Contributor

Thanks for your help @ChristopherCounsell.

I try this expression : date(decimal-date-time(date(${date_pulldata}))) but same issue.

0 Kudos
hgaignard
Esri Contributor

I succeeded after a lot of tries using the following formula to calculate the date field (previous_date_signalement): date-time(int(${date_pulldata}) div 86400000)

0 Kudos