Geopoint edit changes age calculation value

649
2
Jump to solution
06-01-2021 10:39 AM
ryanEvanczyk
Occasional Contributor

I found a problem with my work flow due to fixing incorrectly placed geopoints through the data tab in the Survey123 website. The survey is an "incident form" where we collect patient information including an incident location. Some of our employees are part-time and put the geopoint in the wrong place. Our staff uses a shared creator/user login to complete all of the surveys in our first aid room. When they complete the survey in the first aid room, they set the geopoint. This incident form includes a section where the patient dob is input and then an age is calculated which cues a guardian information section if the patient is <18yr old.

Our work flow has a small group of employees with a separate creator/user that allows them to edit records. They login to the survey123 website and then review the days surveys from the data tab. They complete a few questions at the end of the survey via the table in the data tab. However, to fix the location we use the "form view" and then we "edit." When we edit the location in the "form view", it then changes the age to 0 which cues the guardian info section (if relevant, this is a required field). When we update things in the table view this doesn't happen. 

The reason for the work flow going this way and not via the inbox is we didn't want the entire staff to have editing access to any sent forms (the sent folder is disabled too). If we could have the inbox enabled and then limit editing by adjusting the user access that would work too.

Is there a way to change my calculation? Is there another way to change the work flow besides enabling the inbox? Is there a way to enable the inbox, but prevent all users from having editing access?

My age/dob section of the form is attached.

0 Kudos
1 Solution

Accepted Solutions
Ruth_JiatengXu
Esri Contributor

Hi @ryanEvanczyk 

Sorry for the late response. I think the possible cause of the issue is that the web app only supports decimal date-time format right now, while the field app supports both UNIX(epoch) date-time formats.

Although I cannot reproduce the issue using the formula you provided, I guess the age is calculated and submitted on the field app originally, and then you edit the data using the form view which is web app. The web app recalculates the age and returns the incorrect 0.

To make the age calculation work on both field app and web app, you need to change the calculation formula to use the decimal date-time format. Try this in the calculation of pt_age:

(decimal-date-time(today()) - decimal-date-time(${pt_dobstring})) div 365.250

Ruth_JiatengXu_0-1624970327578.png

Another workaround is to change the note question to text (please note the question cannot be set to read-only), then the field will not be automatically recalculated on the web app. Please be careful since the question type change may affect the data you already collected.

Ruth_JiatengXu_1-1624970862598.png

I suggest you try the first option, if it does not work, please feel free the reply, I will get back to you ASAP. If it is possible please let me know what is in your ${form_incident}, it will help us reproduce the issue you encountered.

Thanks,

Ruth

View solution in original post

2 Replies
Ruth_JiatengXu
Esri Contributor

Hi @ryanEvanczyk 

Sorry for the late response. I think the possible cause of the issue is that the web app only supports decimal date-time format right now, while the field app supports both UNIX(epoch) date-time formats.

Although I cannot reproduce the issue using the formula you provided, I guess the age is calculated and submitted on the field app originally, and then you edit the data using the form view which is web app. The web app recalculates the age and returns the incorrect 0.

To make the age calculation work on both field app and web app, you need to change the calculation formula to use the decimal date-time format. Try this in the calculation of pt_age:

(decimal-date-time(today()) - decimal-date-time(${pt_dobstring})) div 365.250

Ruth_JiatengXu_0-1624970327578.png

Another workaround is to change the note question to text (please note the question cannot be set to read-only), then the field will not be automatically recalculated on the web app. Please be careful since the question type change may affect the data you already collected.

Ruth_JiatengXu_1-1624970862598.png

I suggest you try the first option, if it does not work, please feel free the reply, I will get back to you ASAP. If it is possible please let me know what is in your ${form_incident}, it will help us reproduce the issue you encountered.

Thanks,

Ruth

ryanEvanczyk
Occasional Contributor

@Ruth_JiatengXu 

Switching to decimal date time worked....thank you so much!

 

RyanE

0 Kudos