Select to view content in your preferred language

Complicated CSV pull data question.

608
6
Jump to solution
09-14-2023 08:18 AM
Bryan_Wade
Occasional Contributor

My organization uses survey123 to collect damage assessments following a disaster. I would like to use the pull data function in Survey123 Connect to populate a question. The damage assessment comprises 3 surveys (Master, Field User, and Office Reviewer). The field user and office reviewer surveys connect to the master through the submission URL.

Where is the best place to put my CSV that contains the list of event numbers? I would also like to ensure the surveys pull the most recently added event number from the CSV.

I have thought of using a survey to create the event number, but the issue I have is that some of our users operate in areas where there is little to no cell service, so pulling from another feature service wouldn't be practical when that happens.

Any assistance would be greatly appreciated

0 Kudos
2 Solutions

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

I would take a look at Linked Content.  It allows you to update a central CSV at regular intervals.  So close to live time without being live time.

Note there are issues with forms getting updates to the CSV when following a launch link.  Hopefully that is fixed soon.  Test this in your workflows.

Take a look here  https://community.esri.com/t5/arcgis-survey123-blog/work-with-csv-data-in-arcgis-survey123/ba-p/1157... 

You could schedule the update with Python here  https://developers.arcgis.com/survey123/guide/update-csv-item/ 

View solution in original post

abureaux
MVP Regular Contributor

I'm in a lazy mood. So simple answer that comes to mind is choice_filter.

Add a third column to your CSV called display (for example), then add this to your select_one's choice_filter: display='yes'

Now, all values that have "yes' in the display column will be valid choices.

This is almost like hard-coding the result though, and relies on users having up-to-date CSVs to get a correct selection. Going back to what Doug mentioned below, this can sometimes be an issue. Also, I am unsure of your workflow, so not sure if this is the solution you are actually looking for.

View solution in original post

6 Replies
DougBrowning
MVP Esteemed Contributor

I would take a look at Linked Content.  It allows you to update a central CSV at regular intervals.  So close to live time without being live time.

Note there are issues with forms getting updates to the CSV when following a launch link.  Hopefully that is fixed soon.  Test this in your workflows.

Take a look here  https://community.esri.com/t5/arcgis-survey123-blog/work-with-csv-data-in-arcgis-survey123/ba-p/1157... 

You could schedule the update with Python here  https://developers.arcgis.com/survey123/guide/update-csv-item/ 

abureaux
MVP Regular Contributor

Second vote for Linked Content.

I have several forms with a similar workflow to what you described. All use Linked Content in some fashion.

Bryan_Wade
Occasional Contributor

@DougBrowning and @abureaux  It looks like the linked content is going to be the best option. Is there a way to get the survey to pull just one item off the CSV to populate the question instead of creating a list?

For example, the CSV contains 10 event numbers, but I need the survey to pull the event number that is at the top of that CSV list. Not all 10 event numbers. I don't want to confuse our staff that is in collecting te data in the field

0 Kudos
abureaux
MVP Regular Contributor

I'm in a lazy mood. So simple answer that comes to mind is choice_filter.

Add a third column to your CSV called display (for example), then add this to your select_one's choice_filter: display='yes'

Now, all values that have "yes' in the display column will be valid choices.

This is almost like hard-coding the result though, and relies on users having up-to-date CSVs to get a correct selection. Going back to what Doug mentioned below, this can sometimes be an issue. Also, I am unsure of your workflow, so not sure if this is the solution you are actually looking for.

Bryan_Wade
Occasional Contributor

That would actually work for our workflow. We would be updating the CSV manually prior to each event since the event is typically sporadic and we have time before the damage assessments are assigned to make those updates.

0 Kudos
abureaux
MVP Regular Contributor

Excellent! Glad to hear this will work for you.

0 Kudos