# Inserting into MSSQL-Plus Node through Dashboard Form Inputs

**URL:** <https://discourse.nodered.org/t/inserting-into-mssql-plus-node-through-dashboard-form-inputs/72095>\
**Category:** Dashboard\
**Created:** [12 December 2022 19:40 UTC](https://discourse.nodered.org/t/inserting-into-mssql-plus-node-through-dashboard-form-inputs/72095 "2022-12-12T19:40:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![KAMERONSWENSON](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@KAMERONSWENSON](https://discourse.nodered.org/u/KAMERONSWENSON)\
**Post date:** [12 December 2022 19:40 UTC](https://discourse.nodered.org/t/inserting-into-mssql-plus-node-through-dashboard-form-inputs/72095/1 "2022-12-12T19:40:40Z")

</div>

I am trying to insert values into MSSQL node. I input values from a form then click a submit button to insert the values to the database. The values come out in an object. I use the change nodes to parse each of those values out into single values, then use another change node to create them into global variables to reference them in a function node. Reasoning in me doing that is I don't want the function node to activate if I have multiple submit buttons on the form. I want everything tied to one button. However, when I try to insert the data I get an (Invalid column name Test1 and Test2) error. Those are my values I input not the individual object names. When I change the column names in the database to the column names listed in the debug it then throws the error that is can't find BatchNumber or WorkOrderNumber. Please help. Thanks.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/5/f594cbf898f8d673f26a7374b0c6a5bb8fea65a5.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/3/b3b3a43784a7d7f7c40943e40a431e42186fdc39.png)

---

<div class="post-metadata">

**Author:** ![KAMERONSWENSON](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@KAMERONSWENSON](https://discourse.nodered.org/u/KAMERONSWENSON)\
**Post date:** [12 December 2022 19:44 UTC](https://discourse.nodered.org/t/inserting-into-mssql-plus-node-through-dashboard-form-inputs/72095/2 "2022-12-12T19:44:28Z")

</div>

This is also the function I am using to grab the global variables  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/a/0af5e50cd03c90ea7301869f35cbfde1df615fb7.png)

---

<div class="post-metadata">

**Author:** ![KAMERONSWENSON](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@KAMERONSWENSON](https://discourse.nodered.org/u/KAMERONSWENSON)\
**Post date:** [12 December 2022 20:02 UTC](https://discourse.nodered.org/t/inserting-into-mssql-plus-node-through-dashboard-form-inputs/72095/3 "2022-12-12T20:02:10Z")

</div>

It looks like if I remove the "SET" statements in my SQL insert I don't get an error but I also don't get data inserted i just get NULL values in the database

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [12 December 2022 22:48 UTC](https://discourse.nodered.org/t/inserting-into-mssql-plus-node-through-dashboard-form-inputs/72095/4 "2022-12-12T22:48:09Z")

</div>

1. Delete everything except the form node and SQL node & 2 debug nodes
2. Connect the form to 1 debug and to SQL node
3. Connect SQL output to 2nd debug
4. Setup the SQL node to use parameters
5. Enter test values into the form and submit (so you get form values in debug panel)
6. Use the copy path from the debug msg to populate the parameters

There is no need for global context.

See [this post](https://discourse.nodered.org/t/query-via-modbus-tcp-mssql-zero-values/71785/9) for an example of how to do parameters

* * *

Copy path...

There’s a great page in the docs ([Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

---

<div class="post-metadata">

**Author:** ![KAMERONSWENSON](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@KAMERONSWENSON](https://discourse.nodered.org/u/KAMERONSWENSON)\
**Post date:** [13 December 2022 13:05 UTC](https://discourse.nodered.org/t/inserting-into-mssql-plus-node-through-dashboard-form-inputs/72095/5 "2022-12-13T13:05:52Z")

</div>

This worked thank you! Very well said.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [27 December 2022 13:05 UTC](https://discourse.nodered.org/t/inserting-into-mssql-plus-node-through-dashboard-form-inputs/72095/6 "2022-12-27T13:05:57Z")

</div>

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