Page 1 of 1

Edit Mapping Response to label

Posted: Fri Jun 14, 2013 1:19 pm
by andres prenza

how to map to data from the response to one field to use them both adding javascript? is it possible? i need to do something with a date depending if the status is true or false. Going to a label.


Edit Mapping Response to label

Posted: Fri Jun 14, 2013 1:54 pm
by Kateryna Grynko

Hi Andres,

Not sure I understand you.
Please clarify what you want to do?


Edit Mapping Response to label

Posted: Fri Jun 14, 2013 2:05 pm
by Alvaro Peralta

Hi, I'm working on the same project and Andres has asked me to help clarify. On the data tab on Appery, we are able to map data from our API to the label. We want to be able to access two different data items in one label, so that we may write javascript code using the two items.


Edit Mapping Response to label

Posted: Fri Jun 14, 2013 2:35 pm
by Kapow36

If you are trying to map two items to one label, then you need to use some code similar to this (using the add javascript button)...

code
if (element.text().length > 0)
{
value = value + "," + element.text();
}
return value;
/code

this will separate each item by a comma in your label, but you can do whatever you want


Edit Mapping Response to label

Posted: Fri Jun 14, 2013 5:48 pm
by andres prenza

this did not help . nothing is inside the label to begin with. we will assign something with the javascript.


Edit Mapping Response to label

Posted: Fri Jun 14, 2013 6:15 pm
by Maryna Brodina

Hi, it should work the way Kapow36 suggested. Please check are there any errors in console and post mapping screenshot.