Page 1 of 1

Append data to a json response

Posted: Sat Apr 27, 2013 11:40 pm
by Andrés Méndez

Hello.

I have a JSON which gives me two data:

  • Price: The price of an item, for example "5". I show that info inside a label, but I want to show "5€". How can I add text to the response?

  • URL: The URL of a picture, for example "/images/photo.jpg". But the image isn't shown because it lacks the starting http://www.domain.com. How can I add "https://www.domain.com" to the begining of the response?

    Thanks in advance.


Append data to a json response

Posted: Sun Apr 28, 2013 12:04 am
by Illya Stepanov

Hello Andrés,

You can use button "Add JS" in your mapping:
Image

to add symbol "€" after cliking "Add JS" button write code:
codereturn value + "€&quot/code

If you want to add a name of a site then code will be the following:
codereturn "https://www.domain.com" + value;/code


Append data to a json response

Posted: Sun Apr 28, 2013 12:17 am
by Andrés Méndez

Hello Illya.

Thanks for your fast answer. It works great :-)


Append data to a json response

Posted: Sun Apr 28, 2013 12:57 am
by Illya Stepanov

Glad to help! :-)