Possible to iterate values in external CSV using Pulldata() and a Repeat?

11-03-2020 08:11 AM
New Contributor II

We have a situation where we are trying to do Hazardous Waste inspections using Survey123. For the inspection, our staff goes into the field to review the details of the HW Generator and their waste types.

Both the details and waste types by generator were provided in .csv and have been uploaded to the media folder. I’m using the pulldata() functionality to return both the generator details and the waste types.

The process kicks off when the inspector enters the generator number into the Gen_No field (Numeric code e.g. 10). The generator details are then returned using a Pulldata() calc from the HW_GEN.csv like so:

pulldata('HW_GEN','Generator_Name','Gen_No', ${Gen_No})

This calc works fine as there is a one to one relationship between the generator and their contact details.

What I didn’t realize is that each generator can produce multiple kinds of waste (anywhere between 1 and 47), making this a one to many relationship. Using the same type of Pulldata() calc on the HW_Waste.csv only returns the first waste value. So, if there are 10 it only grabs the first one.

pulldata('HW_Wastes','Waste_Name','Gen_No', ${Gen_No})

Is there a way to use pulldata() or another method to pull the waste types from the HW_Wastes.csv table into the form and then iterate through them? Ideally, using a repeat or something that will allow the inspector on site to quickly swipe through the waste types for each producer? Ultimately, some of the amounts change and the inspector must edit the value in the amounts field.

I know this isn’t the greatest use case for Survey123, but the inspectors really like the form-based approach.

All files including the form are attached.

0 Kudos
1 Reply
Esri Esteemed Contributor



Unfortunately, the pulldata() function is only designed to retrieve one value, not a series of values.  This is an interesting idea; perhaps you could create a post in the Ideas section so that other, similar use cases could be described and help round out what would be needed to support this?

0 Kudos