I’m trying to consume an NHS API, but LibertyCreate is not letting me map the response with an API call response template because the syntax is invalid.
Can anyone offer any advice? The problem seems to be the existence of the \. I think I could save the entire value of the array to a text multi line and the write some code to parse it, but i’d prefer not to.
Hi Craig,
I believe you guessed it right: it is time to write a Response Payload Preprocessor.
A preprocessor that gets rid of the backslashes () in this string. Once done the rest of the response payload seems a valid JSON string i.e. " “:” "
Hi Craig, that is actually JSON converted to a string - I would be tempted not to just get rid of the backslashes as you may miss some other things. Useful starting point for a data processor:
var transformed_fields = params.fields;
var payload = JSON.parse (transformed_fields.payload);
// mats.log (JSON.stringify(payload));