I am using the HTTPRequest node to post to an endpoint. The body parameter needs a json value which I need to create using expressions. However, some fields in the value field’s json needs to be pulled in from the previous node.
The issue is in the “name” parameter of the body parameters. The json should look like below where given, family etc must be pulled from the node’s input params:
{{ [
{
“use”: “official”,
“family”: “n8nlast1”,
“given”: [
“f1”,
“l1”
]
},
{
“use”: “usual”,
“given”: [
“f1”
]
}
]
}}
The expression creation UI renders the resulting json properly but the node detail screen shows an error “bodyParametersUI.parameter[1].value has an expression!”.
{
“nodes”: [
{
“parameters”: {
“requestMethod”: “POST”,
“url”: “https://xxx.preview.canvasmedical.com/Patient”,
“options”: {
“fullResponse”: true
},
“bodyParametersUi”: {
“parameter”: [
{
“name”: “resourceType”,
“value”: “Patient”
},
{
“name”: “name”,
“value”: “={{ [\n {\n “use”: “official”,\n “family”: “{{$json[“lastName”]}}”,\n “given”: [\n “f1”,\n “l1”\n ]\n },\n {\n “use”: “usual”,\n “given”: [\n “f1”\n ]\n }\n ]\n}}”
},
{
“name”: “birthDate”,
“value”: “1980-11-13”
},
{
“name”: “active”,
“value”: “={{true}}”
},
{
“name”: “extension”,
“value”: “={{ [\n {\n “url”: “”,\n “valueCode”: “UNK”\n }\n ]\n}}”
}
]
},
“headerParametersUi”: {
“parameter”: [
{
“name”: “Authorization”,
“value”: “Bearer xxx”
}
]
}
},
“name”: “HTTP Request1”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 1,
“position”: [
720,
740
]
}
],
“connections”: {}
}
Share the output returned by the last node
Information on your n8n setup
- cloud, test instance