How is pull data updated?

1739
21
06-11-2019 06:35 AM
deleted-user-4eCuGRDZm2v8
New Contributor II

I need to create a browser based survey that at first, searches through a list of addresses within our city.  I understand I can do this using a CSV and the pull data function but how is the data updated?  If I run a script to update the CSV do I have to republish the survey each time?

Scott

Tags (1)
0 Kudos
21 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Scott,

Yes, the survey will need to be republished when the CSV is updated.  That can be done either manually or automatically; see Updating the media folder of a Survey123 Form item for information on how to automatically do this.

0 Kudos
deleted-user-4eCuGRDZm2v8
New Contributor II

Thanks for the feedback James, I'll look into it.

Scott

0 Kudos
deleted-user-4eCuGRDZm2v8
New Contributor II

Separately, I'm having issues using the csv for user selection.  Do I need to do pulldata function and then select_one or can I just select_one and reference the csv?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

I would suggest first having the pulldata function populate a text or note question to confirm that you are seeing teh values you expect - in particular, extra commas in the table can cause the wrong values to be retrieved.

0 Kudos
deleted-user-4eCuGRDZm2v8
New Contributor II

I've created the file and uploaded it using Survey123 Connect but an error occurs when I run the script.  Am I missing something?

Error:

...Starting
...Authenticating
...Querying
Runtime error 
Traceback (most recent call last):
  File "<string>", line 105, in <module>
KeyError: 'name'

Script:

102  print ("...Querying")
103  # get the name of the zip file
104  serviceInfo = getServiceDefinition(agol_helper.token, itemID)
105  zipFileName = serviceInfo['name']
106  print ("Zip file name: " + zipFileName)
0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Scott,

That error indicates that the script had an issue getting information via the feature service.  Is this using an existing feature service?  You may want to create a hard-coded version with the name of the zip file (same as the XLS file) pre-set in that case.

0 Kudos
deleted-user-4eCuGRDZm2v8
New Contributor II

I changed the links in the script to https and that seems to have fixed it.

However, the script doesn't seem to be updating the data.  I'm using the external choice list option.  The script completes successfully but the choice list isn't updated.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Just to confirm, you are not seeing the update after manually updating (or deleting and redownloading) the form on the device?

0 Kudos
deleted-user-4eCuGRDZm2v8
New Contributor II

Yes that's correct, but I'm using the web form.

0 Kudos