Populating a select_one_dropdown with the results of an ajax call (Unexpected token & (on form conversion) ODK 2

Hi,

Maybe this helps someone else

I kept getting this error 'Unexpected token & (on form conversion)' in the
callback column in my queries sheet. After some head scratching it seems
this was related to having white spaces in the callback function. What
worked on rev 204 was this

query_name query_type uri callback

country_list ajax "https://query.yahooapis.com/v1/public/yql?format=json&q="

  • encodeURIComponent("select * from geo.countries where place='North
    America'") context.query.results ? _.map(context.query.results.place,
    function(place){place.data_value = place.name;place.display =
    {text:place.name};return place;}) :

I used this document to work this out ->
https://docs.google.com/document/d/1yZK-rth1298T5Xlje5uVNoQOn_QeUXSWEo3lIiOu-9I/edit#heading=h.40bczktrrlqw
and would have added this infothere but its not editable

Regards

Hi Ian,

Thank you for pointing this out. We've moved the documentation to the
following link.

<goog_1821295874>

Please request edit access. We will make sure that you can add your
insights.

Thanks,
Clarice

ยทยทยท On Sat, Jul 16, 2016 at 11:53 AM, Ian Lawrence wrote:

Hi,

Maybe this helps someone else

I kept getting this error 'Unexpected token & (on form conversion)' in the
callback column in my queries sheet. After some head scratching it seems
this was related to having white spaces in the callback function. What
worked on rev 204 was this

query_name query_type uri callback

country_list ajax "
https://query.yahooapis.com/v1/public/yql?format=json&q=" +
encodeURIComponent("select * from geo.countries where place='North
America'") context.query.results ? _.map(context.query.results.place,
function(place){place.data_value = place.name;place.display = {text:
place.name};return place;}) :

I used this document to work this out ->
https://docs.google.com/document/d/1yZK-rth1298T5Xlje5uVNoQOn_QeUXSWEo3lIiOu-9I/edit#heading=h.40bczktrrlqw
and would have added this infothere but its not editable

Regards

--
You received this message because you are subscribed to the Google Groups
"ODK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.