Issue connecting a hosted csv file to a survey form

1487
10
Jump to solution
12-13-2021 11:49 AM
3CDCOrganizationalAccount
New Contributor III

I am trying to connect a hosted csv file to one of my surveys, but when I try to select an option in the survey, all the options appear as "label" instead of the actual data from the file. 

3CDCOrganizationalAccount_0-1639424800346.png

The csv has been uploaded to my ArcGIS Online account and linked to the survey. The number of matches in the pull down also equal the number of items within the csv file so I know it is reading something correct. Any ideas what could be causing this error?

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

Do you have a name and label column in the CSV?  Kinda flying blind here without the form.

View solution in original post

10 Replies
DougBrowning
MVP Esteemed Contributor

You did not post any of the code but are you use search() like this 

select_one SpeciesList      autocomplete search("CSVFileName', "matches", "AllWithoutNone", "Y")

If so did you add the column mapping in the choice tab like this.  That tells it which columns to use in the csv since they do not have to be name and label.  

DougBrowning_0-1639426273110.png

Hope that does it.

0 Kudos
3CDCOrganizationalAccount
New Contributor III

I think I updated the code to include column mapping in the choice tab, but the issue is still the same.

0 Kudos
3CDCOrganizationalAccount
New Contributor III

Here is what my code looks like 

3CDCOrganizationalAccount_0-1639431030879.png

3CDCOrganizationalAccount_1-1639431081088.png

 

0 Kudos
DougBrowning
MVP Esteemed Contributor

should be select_one Operations_Staff  (so remove the .csv).  Also you cannot end a field name with _ I think.  Remove that.  

And you matches query looks like you have mine in there?  You want your own query that makes sense or remove it.  If you do not need a query then instead of search you could do select_one_from_file instead and remove the list from choices tab. Seems like you are trying to do both vs one or the other.

Hope that helps

0 Kudos
3CDCOrganizationalAccount
New Contributor III

I am trying to reference a CSV hosted online so every time our staff changes I do not have to update multiple surveys. The CSV is simple; it is a single field of staff names with a header called "name". I am not trying to do any query really. I tried select_one_from_file first but the same issue continues to happen

0 Kudos
DougBrowning
MVP Esteemed Contributor

Ok I would then use select_one_from_file Observers.csv like that instead.  Then use the Linked Content tab to link to the CSV that you host on AGOL.

Go to 22:51 in this video  https://www.youtube.com/watch?v=rrQZNaqcCYI

 

0 Kudos
3CDCOrganizationalAccount
New Contributor III

That is what I did originally. I the tutorials online, and I seem to be accessing the CSV because the number of matches in the list corresponds with the number of names in the CSV. The issue is that the names from the list are not appearing but the word "label" repeatedly. So it seems to be misreading the CSV file? I am not sure if this was a common error or not

0 Kudos
DougBrowning
MVP Esteemed Contributor

Do you have a name and label column in the CSV?  Kinda flying blind here without the form.

DougBrowning
MVP Esteemed Contributor
0 Kudos