Pulldata with Previous Survey Submissions

613
2
03-19-2021 04:19 PM
dgray
by
New Contributor III

Hi,

Is it possible to use a Pulldata statement in Survey123 to add a note with data from a previous survey submission?   Here's my use case:

We have COVID-19 daily screening forms we have to do before entering our office, whether staff or visitor, to declare that the person is clear/not clear to enter.  A lot of us have become forgetful in completing our forms every day.  What I would like is, for example, once you indicate your name in the screening form, to get a note that tells you the last time you submitted that form.  Is this possible?  If so, how? 

Any other ideas of ways to remind people to submit their forms would also be welcome.  Some staff work from home, so the form does not always apply to everyone every day.  We have connectivity between Survey123 and Microsoft Power Automate to send e-mails, for example, but sending people unnecessary reminders might annoy them, so that's why I was thinking adding a note to the survey would be more appropriate, although I'm still open to other ideas to solve this problem.

Any help would be appreciated!

Thanks!

2 Replies
IsmaelChivite
Esri Notable Contributor

Hi @dgray  Attached is a solution with a custom JavaScript function. Basically, I query the feature layer of the survey to retrieve the newest record submitted by the currently logged-in user and I get the submission date of the record.  The form assumes that the user is logged-in and that Editor tracking is enabled in the layer.

  • Use the Create Survey from File option to import the XLSForm.
  • Copy the scripts folder into the survey directory
  • Publish the survey and submit records to see how it works.

I hope it helps.

LastSubmitted.gif

 

dgray
by
New Contributor III

Hi IsmaelChivite,

Wow, this looks great!  One question though.  We don't have users login for this survey; rather, the staff name is chosen using a Select One picklist.  What kind of modification could I make to this script to make it work based on an attribute, not based on a user login name?

0 Kudos