set the label text when a response is returned as "undefined"
I think I can answer my own question. I added js to the label field that was coming back sometimes as undefined like this:
codeif(value === undefined){ return ''; }/code
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
I think I can answer my own question. I added js to the label field that was coming back sometimes as undefined like this:
codeif(value === undefined){ return ''; }/code
I got it work with this
if(value === undefined) return ('');
Hello,
i got the same prob. and saved it in this way.
open the data tab of the page
select mapping data of the service and take care that on your left side the reponse tab is selected
on the right side click the edit js button of the related text which serves the "undefined" value
4.
insert the following js and change my values with yours:
var show_mil_state = parseInt(Appery('change_mil_state').text());
if(show_mil_state = 'false') {
$("[name=show_mil_state]").text("no Malfunction");
} else {
$("[name=show_mil_state]").text("MIL ALert !!!");
}
-replace show_mil_state with your label name
-replace false with undefined
-replace "no Malfunction" and "MIL ALERT !!!") with the values that you will show
hopes this helps
Mathias
Hello Mathias,
Thank you for the update, sure this information will be useful!