Escape & character JSON

Viewed 30

We use an API call to trigger some automated processes. The info that is needed in those API calls are send through JSON. For some reason (or maybe a good reason) a & character is turned into &amp.

Now, this JSON field where the & occurs is not static. It depends on user input so sometimes there is a & and sometimes not. I guess I have to do something with pasting, but I have no clue how. So, this is a part of the code that handles the pasting.

"JobTitle":"${requestField?keep_after("Functienaam:<br/>- ","r")?keep_before("<br/>")}"

So, what I want is that the & don't get turned into &amp because it is commonly used to determine that 1 person has to departments (like P&O) in our AD and now it will be shown as P&ampO.

Hope someone can help me out.

Thanks in advance.

0 Answers
Related