Select to view content in your preferred language

Pulldata not working on web form but is working in Survey123 app

841
2
Jump to solution
10-08-2023 03:29 PM
BEdwards
New Contributor

Hello,

I have a linked CSV file that has per diem rates in it.  I am trying to use the pulldata function to bring in rates based on the zip code and fiscal year.  The function works perfectly in Survey123 Connect version 3.18.124 and in the survey app however it won't load anything when using a web browser.  I can't figure out why it works in the app but not on the web.  I have a different CSV file for employee information in this same form using the same functionality and it works perfectly.

Here is the calculation.  "per_diem_rate" is the name of the csv files, meals is where the number I need returned is location, zip and fiscalyear are the two fields I am filtering by.

pulldata('per_diem_rates', 'meals', 'zip', ${class_zip}, 'fiscalyear', ${class_year})

XLS_and_CSV_Files 

GSA_Calc.jpg

 

 

0 Kudos
1 Solution

Accepted Solutions
ChipMorgan65
Frequent Contributor

Hi,

   What you're doing makes sense, but I don't see anything in the pulldata doc that supports multiple criteria like you've specified. I recommend that you request this as a new feature.

   In the meantime, a crude workaround would be to concatenate the zip and fiscal year columns into a third column in the CSV and then do a single criteria lookup based on that other column. 

   Let's call that third field fiscal_year_zip. Concatenate the fiscal year and zip fields into that third field with a - (dash) between the two fields for readability. You can do this automatically with an Excel concat function, but understand that the function will be collapsed to values when saving the CSV file.

   You could then revise your pulldata as follows:

      pulldata('per_diem_rates', 'meals', 'fiscal_year_zip', ${class_zip}-${class_year})

   I'm doing this off the top of my head, so I might well be missing something.

Chip

View solution in original post

0 Kudos
2 Replies
ChipMorgan65
Frequent Contributor

Hi,

   What you're doing makes sense, but I don't see anything in the pulldata doc that supports multiple criteria like you've specified. I recommend that you request this as a new feature.

   In the meantime, a crude workaround would be to concatenate the zip and fiscal year columns into a third column in the CSV and then do a single criteria lookup based on that other column. 

   Let's call that third field fiscal_year_zip. Concatenate the fiscal year and zip fields into that third field with a - (dash) between the two fields for readability. You can do this automatically with an Excel concat function, but understand that the function will be collapsed to values when saving the CSV file.

   You could then revise your pulldata as follows:

      pulldata('per_diem_rates', 'meals', 'fiscal_year_zip', ${class_zip}-${class_year})

   I'm doing this off the top of my head, so I might well be missing something.

Chip

0 Kudos
BEdwards
New Contributor

Thanks for help!  I had to create a separate field in survey123 to concatenate the ${class_zip} and ${class_year} fields but I was able to then filter by the new field and it did work on both the app and web.  I will put in for a feature request to be able to filter by multiple columns.  

0 Kudos