Survey 123 pulldata functionality?

1077
8
02-17-2020 07:59 AM
AdamLevine
New Contributor

In the past I have used the pulldata function to access data from a csv file pulling from a specific record.....I was wondering if there is a way to use the pulldata function (or another way) to 'cycle' through a file of data for verification.   

My use case is to be able to walk into a building - select the building entered and then cycle/scroll through all of the spaces in that building one by one (pulling 5+ fields of information) and check a box verified or not verified (with a list of reasons why).  SO instead of having to type in room by room just having it scroll through the list of areas in that particular building which would save a lot of time.  

Looking for ideas on how/if  this might be able to be accomplished.  Wondering if a repeat can be used with pulldata not repetitive questions.  

Thanks,

Adam

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

Hi Adam,

This may be possible if each space has a unique identifier in the CSV.  As the pulldata function only retrieves one value, you would need to use it inside the repeat and formulate the lookup value per-repeat.

0 Kudos
erica_poisson
Occasional Contributor III

Hi James,

As a very late follow-up question to this...pulldata functions work within repeats, only if the value you are trying to retrieve from your CSV was triggered by a field within the repeat? Since that may be worded poorly, here is an example I am trying with varying success:

Question outside of the repeat:

I want to be able to select the ${Restriction_Name} and have that, in addition to populating the ${Restriction_Number} also populate a number of fields within a repeat for 'Landowner Contact Information'. The way I am structuring the pulldata function in my repeat is:

It seems as if it might intermittently work while I am testing this in Connect, however I am also seeing some weird behavior both in my ${Restriction_Number} field and in my ${Primary_Contact_Name} fields. This strange behavior includes a weird default value in ${Restriction_Number} (this is a required field with no set default), some random quotation marks (") in the ${Primary_Contact_Name} field and (once) unreliably sourced information in the ${Primary_Contact_Name} field (e.g. sometimes it pulls in the ${Restriction_Number} instead...

Example #1 - weird default value present in Restriction Number before a Restriction Name is selected from an autocomplete picklist (select_one question):

Example #2 - weird default value in Primary Contact Name before a Restriction Name is selected (same as above):

My pulldata file is stored in the Media folder as a CSV. There are no field names with spaces in the CSV. It does seem as if some weirdness can be traced to commas within the pulldata CSV fields (can there be no punctuation in the pulldata CSV?), however I am curious about the strange default values in my form. There are no quotation marks in any of the fields within my CSV file.

I am currently testing this as a proof of concept for potential use in one of my established surveys to assist staff with data entry.

Any insight would be appreciated.

Erica

Erica
0 Kudos
DougBrowning
MVP Esteemed Contributor

You for sure cannot have any commas.  I also had issues with people pasting in special chars from book text.

The other issue that did this to be was having line wraps in there.  They were hard to find because the second line was blank.  If you turn on word wrap in excel on the column you can see them.

Another one that got me was using the same name for a list and a field.

It does sound you have some weirdness in your CSV.

If you can post your sheet that will help see it.

Hope that helps.

erica_poisson
Occasional Contributor III

Hi Doug,

It looks like I just need to do a lot of reformatting of the data. I was testing using a CSV that originated as a Google Sheet. Although I thought I'd cleared the formatting, I think there was some latent junk in there. I created a new CSV with a very small subset of the data (cleaned) and it seems to behave properly. I did not expect those weird issues to crop up but now I know - start from scratch!

Your word wrap suggestion was really helpful - I wouldn't have thought to look for that. Once I saw it in my CSV I decided a fresh test was in order.

If you have any other useful tidbits to pass by, I'd be appreciative! Thank you for being so helpful so quickly.

Erica

Erica
0 Kudos
DougBrowning
MVP Esteemed Contributor

I have people sending me CSVs of plant lists from 11 states - that is where I got my list.  They like to copy paste from plant PDF books so it can grab all kinds of scientific notation, commas, new lines, etc.  In the end I find it is usually a human issue not a computer issue.

Starting clean is always good.  Also in excel right click paste works best to remove links, formulas or any formatting.

Glad you got it.  Please mark as correct.

0 Kudos
erica_poisson
Occasional Contributor III

Hi Doug,

One more question on this topic....

My survey has many repeats, some for things like contact information. In some instances we have one survey where there will be two "primary" contacts within a "Primary Contact Info" repeat. Right now, I am able to pull the first primary contact's information from my CSV into the survey via pulldata. Is there any way to use pulldata to bring in information for a second record in a repeat? 

My guess is no, since I am basically creating a 1:1 match between a field in the CSV and a field in the XLSForm, however any insight you might have here would be really appreciated.

Erica
0 Kudos
DougBrowning
MVP Esteemed Contributor

Sorry but I am not following you.  But maybe you mean you have say 2 contact people for 1 appt building?  If so you could maybe have the lookup be name+repeatcount and then add a column to the csv that is buildingname1 and buildingname2.

0 Kudos
erica_poisson
Occasional Contributor III

Sorry - I did a poor job wording that.

I was basically wondering about the repeat count in the lookup, which by your expatiation above seems possible. This is something I will dig into. 

Thanks for you help and patience. 

Erica
0 Kudos