Skip to main content
March 28, 2022
Solved

Return a html code using API

  • March 28, 2022
  • 10 replies
  • 0 views

Good Day!
Goal: Using Get API response the html code stored in my DB.
Issue:
I'm having this issue on my API response on my DB there is no "/' but on my API response it display "/'.
pic for details.

API Response:

    Best answer by stefanhelzle0001

    There is no way to bypass that. JSON uses double quotes to wrap strings. Then a backslash is used to escape double quotes inside the string. Do you create the HTML yourself? If yes, I think you could use single quotes as well.

    10 replies

    harshitb6843
    March 28, 2022

    Hi there,

    Is it causing any problem?

    March 28, 2022

    Hi Sir,
    yes sir it causing a problem in terms of the margin and fonts

    harshitb6843
    March 28, 2022

    Try substituting the \" with " and should resolve your problem. For this, you can use the substitute() method. 

    stefanhelzle0001
    Brainy
    March 28, 2022

    Do you convert the response from an Appian map into JSON? If yes, the backslash is used to escape the quotes. That is the expected behaviour. Once you convert it back from JSON, the backslashes will be gone.

    March 28, 2022

    Hi Sir,
    How can I convert it back to JSON. Do I need to use a function? or adjust my code? Cause I try to used a!toJson() and this is the result. 

    stefanhelzle0001
    Brainy
    March 28, 2022

    It already is JSON. You need to use fromJson().