Can a Survey123 Form Show Query Results as Notation?

71
2
Jump to solution
03-28-2020 07:05 PM
Highlighted
Regular Contributor

So I have a survey for logging workers hours, users enter start and end time and it calculates total hours worked (field type double) and saves to feature layer.

I am hoping to have a notation on this survey form that will query the feature layer, and show the total hours worked by said worker. is this type of functionality available, or have I gone outside of the bounds of survey123?

Note: I have plans on creating a dashboard for the supervisors to view this information, but I thought a notation in the survey form would be great instant feedback to the submitter.

Survey XLS attached, extract pasted here.

typenamelabelcalculation
dateTimeshift_startStart
dateTimeshift_endEnd
calculatetime_workedTime Workedround((decimal-date-time(${shift_end}) - decimal-date-time(${shift_start})) * 24,3)
hiddentemporary_fieldAdding all hours together in a calculation.sum(${time_worked})
notenotationGrand Total Hours Worked ${temporary_field}
Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Frequent Contributor

Hi Ben Van Kesteren‌. I think you could do this with the pulldata() function and a custom JavaScript function within your XLSForm. Have a look at the Early Adopter Documentation we have for this.  Keep in mind that at this moment custom JS functions with pulldata only work in the field app and while a user is logged-in. 

Look at the sample that shows how to do queries through the REST API. It will show you the basic technique you need to get from the server the total hours worked so far so you can terminate the calculation in the form and show the result in a note question.

Since custom JS functions are not yet supported officially, please use the Early Adopter forum if you have additional questions on this particular capability.

View solution in original post

Reply
0 Kudos
2 Replies
Highlighted
Esri Frequent Contributor

Hi Ben Van Kesteren‌. I think you could do this with the pulldata() function and a custom JavaScript function within your XLSForm. Have a look at the Early Adopter Documentation we have for this.  Keep in mind that at this moment custom JS functions with pulldata only work in the field app and while a user is logged-in. 

Look at the sample that shows how to do queries through the REST API. It will show you the basic technique you need to get from the server the total hours worked so far so you can terminate the calculation in the form and show the result in a note question.

Since custom JS functions are not yet supported officially, please use the Early Adopter forum if you have additional questions on this particular capability.

View solution in original post

Reply
0 Kudos
Highlighted
Regular Contributor

Thanks Ismael, I will do that. 

Cheers

Reply
0 Kudos