How do I get a flat response as output instead of JSON array
Solved! Go to Solution.
the response should be plain text?
You can use a JS Callout to do that. The JS looks like this:
var input = JSON.parse(context.getVariable('response.content'));
var output =
"EmployeeRoleType: " + input.organisation.employee.role.type + '\n' +
"Employee Name: " + input.organisation.employee.name + '\n' +
"EmployeeDept: " + input.organisation.employee.department + '\n';
context.setVariable('response.header.content-type', 'text/plain');
context.setVariable('response.content', output);