Hi,
I have a list with multiple items from a database.
I get from the database a value, e.g. -0.1234, and get this value in a label, e.g. list_label_enkel_text.
So far so good, the value -0.1234 is displayed in the app.
But now I want to make the color of the font red if it's a negative value and green if it's a positive value.
I think I can give this a try with this:
code
var x = 'some string';
alert(x.charAt(0)); // alerts 's'
/code
This will give me in the alert 's' so I can make an if ... else construction if the first character is '-' to get the color of the font red.
But I can't get the value of the label in an alert.
I tried the following, all resulting in an empty alert:
code
var input = Apperyio('list_label_enkel_text');
alert(input.text());
var x2 = Apperyio('list_label_enkel_text').text();
alert(x2);
alert(Apperyio('list_label_enkel_text').text());
/code
I set these alerts btw in the Success Mapping, as shown in the image below.
Any idea how to get it done?
Kind regards,
Arie