When i am giving a valid JSON still getting parsing error
I am calling an API and using Apply Parse XML and then calling a JSON DT to map the JSON values on UI:
I cant understand why my rootNode is null and when i am using json DT i am getting error saying invalid JSON eventhough I validated JSON on an online JSON validator.
PFA

@TanyaS58 RootNode becomes null because you are trying to run Apply Parse XML on a value that is basically JSON text, not a real XML structure with child elements (wrapping JSON inside
<Response>...</Response>still leaves only plain text, so Pega cannot build a page tree). The fix is: first run Apply Parse XML only on the actual API XML response (the one that contains tags like<raw>/<derived>), and extract the derived_data/raw string from the parsed page. Then “clean” that string by removing<![CDATA[,]]>, and any XML-escaped characters like",<,>if they exist. After that, run Apply Parse JSON / pxDeserializeJSON on the cleaned JSON string (and map the results from the parsed JSON page, not from the raw text). Also double-check your substring logic: if you useindexOf("</raw>"), make sure you are not cutting off the last}or leaving extra characters before{, because either one will throw “invalid JSON” even if the original payload is valid.