Is it possible to set choices in a dropdown by some function?
Something like this
Code{
"type": "dropdown",
"name": "Catg3",
"title": "Catg3",
"choices": "getCatgOptions()"
},
where getCatgOption return an array of string
Codefunction getCatgOptions() {
let catgArray: string[] = [];
categoryDataJson.forEach((catg: CategoryData) => {
catgArray.push(catg.Category);
});
return catgArray;
}
Survey.FunctionFactory.Instance.register('getCatgOptions', getCatgOptions);