Pulldata('_query','token')

am working on a form in the Global Server (https://ee.kobotoolbox.org) and I need to capture the surveyor’s name from the URL into a hidden field called token.

I configured my XLSForm with the following calculation:

     

pulldata(‘_query’,‘token’)

However, when I try to load the form, I receive the following error message:

     

Error loading
Can’t find _query.csv.

FormLogicError: pulldata with incorrect number of parameters found: pulldata(‘_query’,‘token’)

Could you please confirm if the Global Server is running a version of Enketo that supports _query as a source for pulldata? My goal is to automatically record the surveyor’s name from the URL into the hidden field token.

pulldata() cannot be used for this purpose - it is only used for reading in data from CSV files attached to your form; hence the error message you see.

Can you perhaps describe exactly what you are trying to accomplish here:

I need to capture the surveyor’s name from the URL

But the URL doesn’t intrinsically contain the surveyor’s name… :face_with_raised_eyebrow:

What you might try instead is to prefill the desired field in your form by adding a query parameter (with the surveyors name?) in the URL; this provides a good description of how this works: Prefill fields via URL in Enketo - #4 by knoxjohnny

1 Like