How can I pass default value to textarea of n8n form (2)?

I use Telegram - Send and Wait for Response node, Custom Form, Using JSON:

I expect to receive modified text area content in contentelement, but in reality it passes the original text. What is the purpose to pass the result back as is? How do I get what user input there?

(the previous discussion is here How can I pass default value to textarea of n8n form? , but the topic is already closed)

You were right… edited so so one’s confused

there is no defaultValue for textarea:

Key 'defaultValue' in field 0 is not valid for form fields

1 Like

Ok… Can you please share thus 2 nodes?

I think that in your case you have to send trough url the content.

Definitely is something that has to be configured properly, since you send, but back there s no user input.

```{
  "name": "Test",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "665f2ca8-4d96-4cfa-a65e-2e53f97799e0",
      "name": "When clicking ‘Execute workflow’"
    },
    {
      "parameters": {
        "operation": "sendAndWait",
        "chatId": "877785",
        "message": "test",
        "responseType": "customForm",
        "defineForm": "json",
        "jsonOutput": "=[\n  {\n    \"fieldType\": \"textarea\",\n    \"elementName\": \"content\", \n    \"fieldLabel\": \"Editable Content\"\n  }\n]\n",
        "options": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        304,
        0
      ],
      "id": "e580aa3f-b1f9-4c53-a2f4-d9104ba65ff3",
      "name": "Send message and wait for response",
      "webhookId": "45fea2ed-b14b-468c-a4cb-5708fe03c73f",
      "credentials": {
        "telegramApi": {
          "id": "QPF57F6gg2Otynlg",
          "name": "Telegram account - @poster_n8n_bot"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Send message and wait for response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d4cf5e9f-aa66-4533-b1e0-4063d2e5b253",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "c172a29399dc1695c4e4ebd55e1ca8793799145ee04c4672fbea0a3bdc4ee854"
  },
  "id": "H7l9BTWgyu36oEZm",
  "tags": []
}

and here is my original node:

{
  "parameters": {
    "operation": "sendAndWait",
    "chatId": "877785",
    "message": "=check the code:\n\n```json\n{{ JSON.stringify($json, null, \"  \") }}\n```",
    "responseType": "customForm",
    "defineForm": "json",
    "jsonOutput": "=[\n  {\n    \"fieldType\": \"html\",\n    \"elementName\": \"content\",\n    \"html\": \"<textarea class='form-input'>{{ JSON.stringify($json, null, \"  \").replaceAll(\"\\\"\", \"\\\\\\\"\").replaceAll(\"\\n\", \"\\\\n\") }}</textarea>\"\n  }\n]",
    "options": {
      "responseFormTitle": "=Text",
      "responseFormDescription": "See telegram message",
      "responseFormCustomCss": ":root {\n--container-width: 1000px;\n}\n.form-input {\n  height: 400px;\n}\n\n",
      "appendAttribution": false
    }
  },
  "type": "n8n-nodes-base.telegram",
  "typeVersion": 1.2,
  "position": [
    816,
    -80
  ],
  "id": "2a4788db-5585-4f5d-98c1-c1106f6aa591",
  "name": "Send message for manual correction",
  "webhookId": "82014e4c-ab30-4ac1-a4b1-36cd8356e8fc",
  "credentials": {
    "telegramApi": {
      "id": "QPF57F6gg2Otynlg",
      "name": "Telegram account - @my_bot"
    }
  }
},

Ok… after 2 coffees and one short braining storm with myself, and recheck the docs so I can understand which does and don’t here is what I got as simple for your case :

-The​html fieldType is for displlay only, any you put inside it is visual and not editable in a way that n8n captures…good, I got it.

Noww the p​placeholder text in a native textarea is only a light gray hint that disappears when the user types… it is not editable content, so useer once types will dissappear any content!… Jesus!

The only “workaround I could found it should in the send and wait the json in Message(and user should copy by itself), and in the textarea(native and not Custom!) as form elemnt with fieldName as ‘content’ and as placeholder(which disappear when click) a Hint with “paste here what you copied.

And here the node :

If anyone has a better one , i am curios as well…
Cheers!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.