Describe the problem/error/question
I have build a webform on webflow, it will lookup a stock symbol via TD Ameritrade’s API. I created a webhook that listens to the webflow form (or I should say it post to it). I get the data just fine and I’m able to lookup the stock (see screenshots). However, when it returns the object it does so by put it into an array with the stock symbol name, this causes problems for me when I try to execute a sql query to postgres because it uses the stock symbol in the middle of it and since each time it could be a new stock the query isn’t dynamic (see below)
Example : =INSERT INTO product_data.stock_picker (created_date, symbol,description)
VALUES(‘{{$now.toFormat(‘yyyy-MM-dd’)}}’,‘{{ $json.AMD.symbol}}’,‘{{ $json.AMD.description}}’,)
RETURNING id;
What is the error message (if any)?
This causes problems next time I look up another stock such as TSLA, it tries to use the same query but it wont work since it uses AMD in the query and now the objects are under TSLA
Please share your workflow
Webhook
"meta": {
"instanceId": "ee41659ce8187bdd3290300ba797a7c71a64cf3a2f774cc5e225a57bd807efc5"
},
"nodes": [],
"connections": {}
}
**crypto node (to random a id uuid)**
{
"meta": {
"instanceId": "ee41659ce8187bdd3290300ba797a7c71a64cf3a2f774cc5e225a57bd807efc5"
},
"nodes": [
{
"parameters": {
"action": "generate",
"dataPropertyName": "id"
},
"id": "634ed391-045c-4c10-baae-b9250e7d38ee",
"name": "Crypto",
"type": "n8n-nodes-base.crypto",
"typeVersion": 1,
"position": [
240,
1220
]
}
],
"connections": {}
}
**TD lookup node:**
{
"meta": {
"instanceId": "ee41659ce8187bdd3290300ba797a7c71a64cf3a2f774cc5e225a57bd807efc5"
},
"nodes": [
{
"parameters": {
"url": "=https://api.tdameritrade.com/v1/marketdata/quotes",
"authentication": "genericCredentialType",
"genericAuthType": "httpQueryAuth",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "symbol",
"value": "={{ $json.body.data.Stock }}"
}
]
},
"options": {}
},
"id": "cf41b75c-a51f-47ee-9671-599d599dd19f",
"name": "TDLookUp",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.1,
"position": [
480,
1220
],
"credentials": {
"httpQueryAuth": {
"id": "FWvBYzzdsCuXRwjc",
"name": "MoSoG TD Ameritrade API Key"
}
}
}
],
"connections": {}
}
**Postgres node**
{
"meta": {
"instanceId": "ee41659ce8187bdd3290300ba797a7c71a64cf3a2f774cc5e225a57bd807efc5"
},
"nodes": [
{
"parameters": {
"operation": "executeQuery",
"query": "=INSERT INTO product_data.stock_picker (created_date, symbol,description)\nVALUES('{{$now.toFormat('yyyy-MM-dd')}}','{{ $json.AMD.symbol}}','{{ $json.AMD.description}}',)\nRETURNING id;",
"options": {}
},
"id": "f69d98fa-f377-4166-98e9-dba62a8cc35d",
"name": "Postgres1",
"type": "n8n-nodes-base.postgres",
"typeVersion": 2.3,
"position": [
740,
1220
],
"credentials": {
"postgres": {
"id": "S3yzBHneiKtfh6ne",
"name": "MoSoG DO - Prod - Connection Pool"
}
}
}
],
"connections": {}
}


N8N version: 1.8.2