andres prenza
Posts: 0
Joined: Fri Jun 07, 2013 12:21 pm

Edit Mapping Response to label

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.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Edit Mapping Response to label

Hi Andres,

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

Alvaro Peralta
Posts: 0
Joined: Wed Jun 12, 2013 8:19 pm

Edit Mapping Response to label

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.

Kapow36
Posts: 0
Joined: Thu May 23, 2013 4:07 pm

Edit Mapping Response to label

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

andres prenza
Posts: 0
Joined: Fri Jun 07, 2013 12:21 pm

Edit Mapping Response to label

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Edit Mapping Response to label

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

Return to “Issues”