Michael2210441
Posts: 0
Joined: Sat Jan 04, 2014 5:42 pm

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

Vinny B
Posts: 0
Joined: Fri Aug 22, 2014 2:22 pm

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

I got it work with this

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

Mathias Uebelacker
Posts: 0
Joined: Mon Sep 15, 2014 1:42 pm

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

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

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

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

Hello Mathias,

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

Return to “Issues”