Thanks for the quick response Chris, I try to hard coded value inside for loop but still didn’t work.
But if i hard code value before getResponseOptionsTranslations() as below then i can able to see hard coded value as well as actual result also.
if(options[i].indexOf(’-’)>0){
var arrayString=options[i];
console.log(“arrayString:”+arrayString)
var country = this.restProvider.details.COUNTRY;
let arrStr=arrayString.split(’-’);
alert.addInput({
type: ‘radio’,
label:arrStr[0],
value:arrStr[0],
});
alert.addInput({
type: ‘radio’,
label:arrStr[1],
value:arrStr[1],
});
this.restProvider.getResponseOptionsTranslations(arrayString,country).then(res => {
let transResponses: any =[];
transResponses = res['value'] as string[];
for(var i=0;i<transResponses.length;i++){
if(transResponses[i]["TRANSLATION_VALUE"]!= undefined){
var transRes=transResponses[i]["TRANSLATION_VALUE"];
alert.addInput({
type: 'radio',
label:transRes,
value:transRes,
});
console.log("transRes2:"+transRes)
}
}
});
}
below screen shot, english is default result which is coming from just string split. but the spanish translations are coming from data base.