samirgambhir

Dynamic input for query.outFields

Discussion created by samirgambhir on Jun 26, 2012
Latest reply on Jul 3, 2012 by samirgambhir
Hi,
I a trying to build the query.outFields as a string input based on field selection by user. e.g. If the user selects Crude Birth Rate from the form, I would like to pass field attribute as "CBR_01". I am trying to build this in JavaScript like this:

....
if (valueB=="Crude Birth Rate"){
            var valOutB="CBR_01";
          }
...
var myIndString = "['"+valOutB+"']";

query.outFields = myIndString;
....

This doesn't seem the right way of doing it as it does not execute the query. Any thoughts?
Thanks
Samir

Outcomes