Pulldata function

Hello,

My objective is to pre-set the answers for several questions in the first section depending on the answer to the first question of the survey.

To do so, I have first designed the survey from scratch in the form-builder. After, I have downloaded the survey on an Excel format. Once in the downloaded Excel, I have used the function pulldata. Finally, I have replaced the form with the updated Excel and I have uploaded the file from which I pull the data.

After all this process, I preview the survey and I get the following errors:

  • Can’t find .
  • FormLogicError: Could not evaluate: /model/instance[@id=“Pre-filled_data”]/root/item[Community = ‘’]/Total_solar_capacity_(kW), message: Unexpected args for node test function!{“stack”:[{“t”:“root”,“tokens”:[{“t”:“arr”,“v”:[]}]}],“cur”:{“v”:“/Total_solar_capacity_”,“t”:“fn”,“dead”:false,“tokens”:[{“t”:“arr”,“v”:[]}]}}

At this point, I don’t understand how to avoid the errors mentioned above and I can’t visualize the pre-set answer. Could I get guidance on how to overcome the errors? Otherwise, is there another function to set pre-set answers?

Thank you in advance,

Anna

Hi @Anna2 , thanks for the post.
It looks to me like your approach is sensible.
Two questions:

  1. One thing I always like to try first when troubleshooting an external file (it’s solved errors for me multiple times before) - is to go through and simplify the csv filename and all the csv headers to be short single words, no spaces, no capitals, no special characters. So, things like: predata.csv, totalkw, etc, etc. This just helps me determine that it’s definitely not just a text formatting problem that’s messing with the code somewhere. Can you try this with your file?
  2. If it still gives an error, are you able to attach the XLSForm and csv file?

See if that helps fix any issue, and if not, we can take a further look!
Janna

1 Like