Response Transformer
Transform your JSON response
Visual Response Transformer
You can transform the data from the response with a Visual Response Transformer. To do so, follow the steps:
Click on the
Transform
buttonSelect the root of your response
JavaScript Response Transformer
If you want to transform unstructured responses – you can use a JavaScript response transformer. data
is a variable that stores a response to your request. To do so, follow the steps:
Click on the
Transform
buttonChoose JavaScript Transformation
Write your custom script using
data
variableClick on the
Run
button to send a requestClick on the
Save
button to save it
For example, you can use JS functions to parse the data:
function getProperties(data) {
result = {};
for (var key in data) {
result[key] = data[key]['value'];
}
return result;
}
function contactMapper(contactData) {
result = getProperties(contactData['properties']);
result['dealId'] = contactData['dealId'];
return result;
}
return data['deals'].map((x)=>contactMapper(x));
Last updated
Was this helpful?