Additional columns in external select

731
4
Jump to solution
11-09-2022 07:03 AM
GregKeith
Occasional Contributor III

Howdy,

I have an external select with two csv files, sites and streets, in the media folder. The street field in my survey is correctly being filtered by a choice filter based on the selection in sites.

The streets.csv also has additional fields, such as city, state, zip, owner, phone, etc. However, I can't figure out how to extract that data from the csv. A regular pulldata function doesn't throw an error, but doesn't return anything either. I also don't see an itemsets.csv file in the media folder.

Any ideas on what the problem is and how to fix? Thanks.

Using Survey123 Connect version 3.15.165 with our ArcGIS Enterprise Portal.

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

That is only if you create and use a external choices tab.  Otherwise you call the csv directly.  Not sure why your form is a csv should be a xlxs.

Oh you have commas in there but it still actually works now so that is ok.

You have a choice filter in the pulldata line remove that.  Also no need for a field that is just streets just put it right there like this

pulldata("streets", "sample_csz", "label",${street})

The issue you are having is that street field has a label of 123 main but the name is just 1.  The name is what is stored.  So when it does a lookup on 1 it finds nothing.  You really do not want to store just a 1 in your data.  I suggest change it to name and label the same

DougBrowning_0-1668012348364.png

See attached.  Hope that helps

View solution in original post

4 Replies
DougBrowning
MVP Esteemed Contributor

Can you post the pulldata call or the form.  Not sure why you are talking about itemsets.  You are using streets.csv.

should look like this

pulldata(name of csv without the .csv part, column name to return, lookup column name, lookup value)

I wish they wrote it like this in the help.  The help for pulldata is pretty confusing.

hope that helps

 

0 Kudos
GregKeith
Occasional Contributor III

Sure, thanks. Here are the three files. I was under the impression that S123 created an itemset.csv out of the two files in the media folder. No?

0 Kudos
DougBrowning
MVP Esteemed Contributor

That is only if you create and use a external choices tab.  Otherwise you call the csv directly.  Not sure why your form is a csv should be a xlxs.

Oh you have commas in there but it still actually works now so that is ok.

You have a choice filter in the pulldata line remove that.  Also no need for a field that is just streets just put it right there like this

pulldata("streets", "sample_csz", "label",${street})

The issue you are having is that street field has a label of 123 main but the name is just 1.  The name is what is stored.  So when it does a lookup on 1 it finds nothing.  You really do not want to store just a 1 in your data.  I suggest change it to name and label the same

DougBrowning_0-1668012348364.png

See attached.  Hope that helps

GregKeith
Occasional Contributor III

Awesome, works great now. Thanks @DougBrowning