Select to view content in your preferred language

Importing a CSV table to Survey123 form

3704
2
10-20-2018 02:56 PM
CristianLa_Rosa1
New Contributor II

Hello,

   I am new to Survey123. I would like to import a CSV table into a survey123 survey. The project is about creating a community asset map using ArcGIS hosted services using Survey123. I learned how to create a survey form, but I would have to insert hundreds of records manually if I decide to add them one at a time. Also my table has longitude and latitude columns, is there a way I can set those two columns and have it as a set GPS point for my form?

    I tried inserting my table into the survey media folder and then use pulldata functions to insert my data into the survey form. But, I think I am doing it wrong and I can't figure out how to set the my coordinate columns into a geopoint.  Any help will be highly appreciated. 

csv_data

This is what I have been able to do so far, but the csv data is not linking with the survey form

geonet2

0 Kudos
2 Replies
SMauri
by
Occasional Contributor III

Hi Cristian,

not very clear what you have in mind...

I would have to insert hundreds of records manually if I decide to add them one at a time...

Thers is no need to insert your assets manually...if you have your assets in that CSV file, you can add to ArcGIS Online (Add a layer from a CSV file—Get Started with Map Viewer | ArcGIS ) so you have points from Lat-Lon coordinate.

And then made a survey from this Feature Service Hosted (https://community.esri.com/groups/survey123/blog/2017/09/25/working-with-existing-feature-services-i... ).

Maybe take a look also here: Learn ArcGIS | Try Survey123 Path 

Cheers

Stefano

IngridAldridge1
New Contributor III

Hi Christian,

Okay, you have several options here.

You can add your csv as a feature layer and then create a survey based on the existing Feature Service.  This will require you enabling the inbox and editing from there.  If you want to use the pull data function that will work as well.

Your problem with the pull data is you are trying to pull all the data in one field.  It doesn't do that.  So, rather than that you need to make a few changes.

First, your calculation won't work as you are trying to use the label and not the name in your csv file.  You need the asset_type in your csv to be the same as the name column in your csv.  Otherwise it will never find a match.

Second for each row in your xls where you want to pull data you need a separate pulldata calculation in the calculation column .  For example the calculation for the city row would be pulldata('assets_from_excel', 'city', 'asset_type', ${asset_type}). The type of question can remain a text row but I would question if this is what you want.  Do you want them to be able to write over what is pulled from the csv?  If not you need to consider setting the question as read only or changing it to a calculation type with a note type following showing the value or simply as a note type where the data would then not be stored in the table.  It can get quite convoluted (which is due to the power of Survey123) but it becomes really important to think about why you are pulling the information. 

Additionally, if you have 100s of records do they all have the same city, zip coce, address... It looks like you may be pulling data too early.  Do you maybe need a csv of churches etc? and be pulling data based on the asset_name instead?  Just a thought.

Good luck!