Why is there a difference between my Expression Editor result and actual output in my Webhook Response Node and how to fix it so I get the expected result as my output?
Webhook Response Node → Setting: Respond with JSON
##Expression Editor
{
“results”: [
{
“toolCallId”: “{{ $(‘Webhook1’).item.json.body.message.toolCalls[0].id }}”,
“result”: {
“Business name”: “{{ $json.records[0].fields[‘Business Name’] }}”,
“What the business does”: “{{ $json.records[0].fields[‘Business Nature’] }}”,
“Call scenario”: “{{ $json.records[0].fields[‘Call scenario’] }}”,
“Additional relevant info”: “{{ $json.records[0].fields[‘Additional Relevant Info’] }}”
}
}
]
}
##Result (and expected output)
{
“results”: [
{
“toolCallId”: “call_QRMkhmR7daby3UYEA0l12HIy”,
“result”: {
“Business name”: “Jacksonville Glasses Limited”,
“What the business does”: “Sell glasses to royalty”,
“Call scenario”: “customer information call”,
“Additional relevant info”: “We’re currently out of stock”
}
}
]
}
##Actual Output JSON
NOTICE THIS FORMATTING IS DIFFERENT
[
{
“records”: [
{
“id”: “recjU2FhMSZiu8BQ1”,
“createdTime”: “2025-03-19T07:52:49.000Z”,
“fields”: {
“Business Name”: “Jacksonville Glasses Limited”,
“Call scenario”: “customer information call”,
“Business Nature”: “Sell glasses to royalty”,
“Additional Relevant Info”: “We’re currently out of stock”
}
}
]
}
]
Thanks for your help!