Page 2 of 2

set the label text when a response is returned as "undefined"

Posted: Sat Jul 12, 2014 6:41 pm
by Michael2210441

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


set the label text when a response is returned as "undefined"

Posted: Sat Sep 06, 2014 1:44 pm
by Vinny B

I got it work with this

if(value === undefined) return ('');


set the label text when a response is returned as "undefined"

Posted: Tue Sep 16, 2014 4:15 pm
by Mathias Uebelacker

Hello,

i got the same prob. and saved it in this way.

  1. open the data tab of the page

  2. select mapping data of the service and take care that on your left side the reponse tab is selected

  3. 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


set the label text when a response is returned as "undefined"

Posted: Tue Sep 16, 2014 4:26 pm
by Evgene Karachevtsev

Hello Mathias,

Thank you for the update, sure this information will be useful!