Using Pulldata to populate default value

1861
7
Jump to solution
06-04-2017 02:22 PM
DfIRivers
Occasional Contributor

I can use the pulldata function to populate a notes field in a form (by placing the pulldata function, in the calculate column of the notes field).  But how do I use pulldata function to populate the default column of an integer field?

I've tried placing the same pulldata function in the default column of the integer field; and also using a calculate field to retrieve a value, and then use that field within the default column.. but neither of these methods seem to work.  Is there some workaround that I'm missing?

0 Kudos
1 Solution

Accepted Solutions
JamesTedrick
Esri Esteemed Contributor

Okay, this may be simpler...

After a calculation populates a field, you can alter/update the value of the field.  This will store the updated value unless you change the field the calculation wan based off of.  So you can use the pulldata function to bring in the CSV data and then edit the data that's presented.

View solution in original post

7 Replies
JamesTedrick
Esri Esteemed Contributor

Hi,

No calculations are allowed in the default column (now() and today() being exceptions).  Default values are only applied when the form is loaded.  The pulldata should always be in the calculation column.

0 Kudos
DfIRivers
Occasional Contributor

Hi James,

thanks for the reply... so maybe to better explain what the requirements is.. I have a csv file in the media folder that contains existing asset data.  I was hoping to configure the survey such that I could populate some of the survey fields with this existing data, but allow the surveyor to accept the existing data or to update or correct it... hence why I though populating the default column might be an option.

So is there some there some other means of achieving the same workflow?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Yes, that would be a good use of pulldata.  How are you planning to select the proper row in the CSV file?  Normally that requires you to input an ID of some sort, which is why it's a calculation (done after a value is entered) rather than a default (done when a form is loaded).

An alternative is to be able to edit existing features in a survey - this would load the values previously stored for updating.

0 Kudos
DfIRivers
Occasional Contributor

The CSV file in the media folder contains an AssetID field and the Survey123 form includes a question to select an existing AssetID.  Subsequent fields on the form would then present other data (stored in the CSV) to the user for confirmation or correction.

I can use the "notes" datatype and pulldata() to present the information from the CSV to the form (as read only)... but I can't figure out a way to allow the surveyor to update the information.

The alternative you mention sounds like it might be what I'm trying to achieve.. could you expand on this.  

NB, the asset data is stored in a 3rd party database.. so my workflow as I see it is...

 - Export Asset data from 3rd party database (as ArcGIS fgdb)

 - re-project to WGS 1984

 - add LAT, LONG fields

 - create CSV for Survey123 to use.

 - Conduct Survey123 surveys

 - on completion download surveys (as CSV) from Survey123 website

 - Use functionality in 3rd party system to Import/Update asset information from the downloaded CSV.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Okay, this may be simpler...

After a calculation populates a field, you can alter/update the value of the field.  This will store the updated value unless you change the field the calculation wan based off of.  So you can use the pulldata function to bring in the CSV data and then edit the data that's presented.

DfIRivers
Occasional Contributor

I get it now... I had tried this earlier but hadn't put the reference to the calculate field in the correct place in the XLSForm row representing the data field I was hoping to edit.  Thanks for the steer..

0 Kudos
ShareefTarhini1
New Contributor

Hello! I'm attempting to do the same thing as DflRivers - "populate some of the survey fields with this existing data, but allow the surveyor to accept the existing data or to update or correct it" - and this post is the closest I've come to finding a solution, but the explanation above leaves me confused. When I put the pulldata syntax into the calculation column of the XLSForm, it fails to autofill.

 

Could you explain in greater detail what is required to prepopulate survey fields from a prior CSV?

0 Kudos