Andrés Méndez
Posts: 0
Joined: Thu Apr 18, 2013 6:13 pm

Append data to a json response

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.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Append data to a json response

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

Andrés Méndez
Posts: 0
Joined: Thu Apr 18, 2013 6:13 pm

Append data to a json response

Hello Illya.

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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Append data to a json response

Glad to help! :-)

Return to “Issues”