# Dashboard 2 CRUD node

**URL:** https://discourse.nodered.org/t/dashboard-2-crud-node/89081
**Category:** Dashboard
**Tags:** database, dashboard-2
**Created:** [29 June 2024 11:15 UTC](https://discourse.nodered.org/t/dashboard-2-crud-node/89081 "2024-06-29T11:15:45Z")
**Posts on this page:** 12
**Page:** 2

<div class="post-metadata">

### Author: ![Cyprien](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@Cyprien](https://discourse.nodered.org/u/Cyprien)
#### Post date: [2 July 2024 19:30 UTC](https://discourse.nodered.org/t/dashboard-2-crud-node/89081/21 "2024-07-02T19:30:56Z")

</div>

I've give it to you this screenshot this afternoon  
[![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/e/0e430bdd17817621cf237bbb1f2b04d0fe57fd58.png) ](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/e/0e430bdd17817621cf237bbb1f2b04d0fe57fd58.png)  
Is there a problem with it ?

---

<div class="post-metadata">

### Author: ![Cyprien](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@Cyprien](https://discourse.nodered.org/u/Cyprien)
#### Post date: [2 July 2024 19:37 UTC](https://discourse.nodered.org/t/dashboard-2-crud-node/89081/22 "2024-07-02T19:37:22Z")

</div>

Thanks Steve,  
I will read it carefully...  
Do you think that it's better to scope it with @flowfuse (for easier search) or with @cyprien ?

---

<div class="post-metadata">

### Author: ![Cyprien](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@Cyprien](https://discourse.nodered.org/u/Cyprien)
#### Post date: [2 July 2024 19:46 UTC](https://discourse.nodered.org/t/dashboard-2-crud-node/89081/24 "2024-07-02T19:46:54Z")

</div>

The json keys are not the same. Perhaps you can use sql directive "AS" to change the keys ? Could you post me your query ?

---

<div class="post-metadata">

### Author: ![rafasimple](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rafasimple/32/80215_2.png) [@rafasimple](https://discourse.nodered.org/u/rafasimple)
#### Post date: [2 July 2024 19:48 UTC](https://discourse.nodered.org/t/dashboard-2-crud-node/89081/25 "2024-07-02T19:48:04Z")

</div>

sure  
msg.topic = `SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, IS_NULLABLE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '${msg.tableName}' AND ( (COLUMN_NAME = 'Schedule' AND DATA_TYPE = 'varchar') OR (COLUMN_NAME = 'Lines' AND DATA_TYPE = 'varchar') OR (COLUMN_NAME = 'Scrap' AND DATA_TYPE = 'int') OR (COLUMN_NAME = 'Rework' AND DATA_TYPE = 'int') OR (COLUMN_NAME = 'Duration' AND DATA_TYPE = 'int') OR (COLUMN_NAME = 'Countermeasure' AND DATA_TYPE = 'varchar') )` ;  
msg.action = 'pragma';  
return msg;

---

<div class="post-metadata">

### Author: ![Cyprien](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@Cyprien](https://discourse.nodered.org/u/Cyprien)
#### Post date: [2 July 2024 19:50 UTC](https://discourse.nodered.org/t/dashboard-2-crud-node/89081/26 "2024-07-02T19:50:46Z")

</div>

Could you test by changing the begining of your query ?  
Not sure that your WHERE clause is correct, why don't you return all your fields ?

```auto
SELECT COLUMN_NAME AS name, DATA_TYPE AS type, CHARACTER_MAXIMUM_LENGTH, IS_NULLABLE FROM

```

---

<div class="post-metadata">

### Author: ![rafasimple](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rafasimple/32/80215_2.png) [@rafasimple](https://discourse.nodered.org/u/rafasimple)
#### Post date: [2 July 2024 19:53 UTC](https://discourse.nodered.org/t/dashboard-2-crud-node/89081/27 "2024-07-02T19:53:10Z")

</div>

> [@Cyprien](#):
>
> Could you test by changing the begining of your query ?  
> Not sure that your WHERE clause is correct, why don't you return all your fields ?

msg.topic = ` SELECT COLUMN_NAME AS name, DATA_TYPE AS type, CHARACTER_MAXIMUM_LENGTH, IS_NULLABLE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '${msg.tableName}' AND ( (COLUMN_NAME = 'Schedule' AND DATA_TYPE = 'varchar') OR (COLUMN_NAME = 'Lines' AND DATA_TYPE = 'varchar') OR (COLUMN_NAME = 'Scrap' AND DATA_TYPE = 'int') OR (COLUMN_NAME = 'Rework' AND DATA_TYPE = 'int') OR (COLUMN_NAME = 'Duration' AND DATA_TYPE = 'int') OR (COLUMN_NAME = 'Countermeasure' AND DATA_TYPE = 'varchar') )`;  
msg.action = 'pragma';  
return msg;  
like this?

---

<div class="post-metadata">

### Author: ![Cyprien](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@Cyprien](https://discourse.nodered.org/u/Cyprien)
#### Post date: [2 July 2024 19:57 UTC](https://discourse.nodered.org/t/dashboard-2-crud-node/89081/28 "2024-07-02T19:57:18Z")

</div>

Yes ! like this !

---

<div class="post-metadata">

### Author: ![rafasimple](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rafasimple/32/80215_2.png) [@rafasimple](https://discourse.nodered.org/u/rafasimple)
#### Post date: [2 July 2024 20:04 UTC](https://discourse.nodered.org/t/dashboard-2-crud-node/89081/29 "2024-07-02T20:04:39Z")

</div>

> [@rafasimple](#):
>
> SELECT COLUMN\_NAME AS name, DATA\_TYPE AS type, CHARACTER\_MAXIMUM\_LENGTH, IS\_NULLABLE FROM INFORMATION\_SCHEMA.COLUMNS

i obtain this,

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/8/b81e1cf1289108824a77a14581b0fdf5590ff70e.png)  
but in the dashbord ii have this:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/5/956ec8e2453ec6e3f14e0558ac710de00c51569e.png)

---

<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: [2 July 2024 20:10 UTC](https://discourse.nodered.org/t/dashboard-2-crud-node/89081/30 "2024-07-02T20:10:02Z")

</div>

I think best start off on the right path & use scope but Not FlowFuse. That's our company name 😅

Use you're own scope (whatever you chose).

---

<div class="post-metadata">

### Author: ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)
#### Post date: [3 July 2024 11:08 UTC](https://discourse.nodered.org/t/dashboard-2-crud-node/89081/31 "2024-07-03T11:08:24Z")

</div>

+1 here, the idea of the scoping is to link it to the author. Anything we build, we use `@flowfuse`, any third-party/community pieces should be scoped to the relevant author.

---

<div class="post-metadata">

### Author: ![Cyprien](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@Cyprien](https://discourse.nodered.org/u/Cyprien)
#### Post date: [8 July 2024 19:17 UTC](https://discourse.nodered.org/t/dashboard-2-crud-node/89081/33 "2024-07-08T19:17:26Z")

</div>

Are you on MS SQL ? On sqlite, i use INSERT INTO query and it auto increment the ID, so, i don't specify it.  
I think that it's the same on MS SQL, but i'm not sure... Anyway, it's a database configuration problem.

---

<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: [7 August 2024 19:17 UTC](https://discourse.nodered.org/t/dashboard-2-crud-node/89081/34 "2024-08-07T19:17:55Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/dashboard-2-crud-node/89081.md?page=1)
