I am having some issues with being able to search for the name of the site from an external .csv, and then using that same .csv to pull the site code from.
My .csv is structured as ‘name, site_code’, and the function I am using is ‘pulldata(‘sites’, ‘site_code’, ‘name’, ${site_name})’. Previously I was doing this the other way round, typing in and finding the site code, and then using this to pull out the site name. However, the other way round is more practical in the field. The site names often have spaces in them, and I have removed any special characters that I thought may be a problem. This is an example of the data I have:
name site_code
Arnside Intake Wood L-NY30-12
Baron Wood E-NY54-03
Beck Wood - Smardale E-NY70-18
Beckstones Flush L-NY41-17
However, every time I try to preview the form, it gives me the following error message: ‘TypeError: Cannot read properties of undefined (reading ‘map’)’
Can you think of any reason why this may not be working?
Many thanks,
Okke
Welcome to the community, @okkeoldhouse!
Could you kindly share with us a screenshot so that we could understand your issue pictorially?
Hi Kal,
Apologies for the delay in getting back to you. Please find attached some screenshots of the form, the .csv file I am trying to pull data from, and the error message.
All the best,
Okke
Can you post your actual sites.cvs file, to ensure it is correctly formatted ‘comma-separated values’? pulldata is pretty pedantic about such things…
sites.csv (46.0 KB)
Apologies, it didn’t let me before, here you go.
I have tried to revert back to my initial implementation, which involved using the site codes to pull out the site names, however this has now also stopped working. I receive the same error code, namely ‘TypeError: Cannot read properties of undefined (reading ‘map’)’.
I have attached my XLSform and the relevant additional files. Hopefully you can make sense of it all.
Many thanks,
Okke
Woodlands_survey_form.xlsx (31.5 KB)
habitat_descriptions.csv (2.1 KB)
sites.csv (45.9 KB)
species_list.csv (381.2 KB)
species_list_plants.csv (165.1 KB)