# UI-Template DataBase Help

**URL:** <https://discourse.nodered.org/t/ui-template-database-help/10928>\
**Category:** General\
**Created:** [8 May 2019 20:35 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928 "2019-05-08T20:35:25Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Battassini](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Battassini](https://discourse.nodered.org/u/Battassini)\
**Post date:** [8 May 2019 20:35 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/1 "2019-05-08T20:35:25Z")

</div>

Hello All right with you.  
I'm trying to display values from a database in Firebird and showing them to a table of type UI-Template NODE - I can read normally in the database by SELECT Query but I can not see. I try several examples without success.  
Could someone please give me a help of what I'm doing wrong?

 ![Node01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4cd51a25f127a130c231e7aa9980b578d4702a6c.png)

Attached msg.payload message output: I can read data base OK.

 ![Node02](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a774bfbaeb50ed1989aa90f05b5c93648f6bdeb3.png)

```auto
[{"id":"c7e84e4f.2fcce","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"c80ee3b6.e3a8e","type":"function","z":"c7e84e4f.2fcce","name":"SQL - Select","func":"var select = {topic: \"SELECT * FROM NDBD\"};\nreturn select;\n","outputs":1,"noerr":0,"x":112,"y":235,"wires":[["5ae108cf.0a1588"]]},{"id":"5ae108cf.0a1588","type":"firebird","z":"c7e84e4f.2fcce","firebirddb":"63e7940.44abf6c","name":"BancoDados","x":283,"y":237,"wires":[["e3ed9800.4db168","8ae74f3f.4b261"]]},{"id":"b8b78526.adc458","type":"inject","z":"c7e84e4f.2fcce","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":132,"y":139,"wires":[["c80ee3b6.e3a8e"]]},{"id":"e3ed9800.4db168","type":"ui_template","z":"c7e84e4f.2fcce","group":"8c5b38db.78eea8","name":"Mostra Tabela","order":3,"width":"24","height":"6","format":"<div layout=\"row\" layout-align=\"start center\">\n <span flex><b>Data</b></span> \n <span flex><b>Hora</b></span>\n <span flex><b>Set Point Ar1</b></span> \n <span flex><b>Set Point Ar2</b></span>\n <span flex><b>Temperatura Ar1</b></span>\n <span flex><b>Temperatura Ar2</b></span>\n</div>\n<div layout=\"row\" layout-align=\"start center\" ng-repeat=\"x in msg.payload | limitTo:20\">\n <span flex>{{x.DATA}}</span>\n <span flex style=\"color: green\">{{x.HORA}}</span> \n <span flex style=\"color: red\">{{x.SETPOINTAR1}}</span>\n <span flex>{{x.SETPOINTAR2}}</span>\n <span flex>{{x.TEMPERATURAAR1}}</span>\n <span flex>{{x.TEMPERATURAAR2}}</span>\n \n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":569,"y":123,"wires":[[]]},{"id":"8ae74f3f.4b261","type":"debug","z":"c7e84e4f.2fcce","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":579,"y":213,"wires":[]},{"id":"63e7940.44abf6c","type":"Firebirddatabase","z":"","host":"localhost","port":"3050","db":"C:\\NodeRed\\BancoDados\\NODEREDBD.FDB"},{"id":"8c5b38db.78eea8","type":"ui_group","z":"","name":"Default","tab":"1e230577.890d2b","disp":true,"width":"24","collapse":false},{"id":"1e230577.890d2b","type":"ui_tab","z":"","name":"TESTE","icon":"dashboard","order":3,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [8 May 2019 21:04 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/2 "2019-05-08T21:04:39Z")

</div>

It is not possible to import your code for analysis. Please edit the original post to correct the formatting, taking in consideration the guideline from here:

> [@How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506):
>
> To share code samples or flow json in this forum, you need to take care to format it properly so that it is displayed correctly. The easiest way to do that is to click the 'Preformatted Text' button in the toolbar: [image] Then paste in your code or flow json. You should end up with three back-tick characters - ``` - on their own line before and after the code. On standard US English keyboards, this is on the same key as the ~ character. Using the backticks will ens…

---

<div class="post-metadata">

**Author:** ![Battassini](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Battassini](https://discourse.nodered.org/u/Battassini)\
**Post date:** [8 May 2019 22:17 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/3 "2019-05-08T22:17:55Z")

</div>

Thank you very much for the contact

```auto
[{"id":"c7e84e4f.2fcce","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"c80ee3b6.e3a8e","type":"function","z":"c7e84e4f.2fcce","name":"SQL - Select","func":"var select = {topic: \"SELECT * FROM NDBD\"};\nreturn select;\n","outputs":1,"noerr":0,"x":112,"y":235,"wires":[["5ae108cf.0a1588"]]},{"id":"5ae108cf.0a1588","type":"firebird","z":"c7e84e4f.2fcce","firebirddb":"63e7940.44abf6c","name":"BancoDados","x":283,"y":237,"wires":[["e3ed9800.4db168","8ae74f3f.4b261"]]},{"id":"b8b78526.adc458","type":"inject","z":"c7e84e4f.2fcce","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":132,"y":139,"wires":[["c80ee3b6.e3a8e"]]},{"id":"e3ed9800.4db168","type":"ui_template","z":"c7e84e4f.2fcce","group":"8c5b38db.78eea8","name":"Mostra Tabela","order":3,"width":"24","height":"6","format":"<div layout=\"row\" layout-align=\"start center\">\n <span flex><b>Data</b></span> \n <span flex><b>Hora</b></span>\n <span flex><b>Set Point Ar1</b></span> \n <span flex><b>Set Point Ar2</b></span>\n <span flex><b>Temperatura Ar1</b></span>\n <span flex><b>Temperatura Ar2</b></span>\n</div>\n<div layout=\"row\" layout-align=\"start center\" ng-repeat=\"x in msg.payload | limitTo:20\">\n <span flex>{{x.DATA}}</span>\n <span flex style=\"color: green\">{{x.HORA}}</span> \n <span flex style=\"color: red\">{{x.SETPOINTAR1}}</span>\n <span flex>{{x.SETPOINTAR2}}</span>\n <span flex>{{x.TEMPERATURAAR1}}</span>\n <span flex>{{x.TEMPERATURAAR2}}</span>\n \n</div>","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":569,"y":123,"wires":[[]]},{"id":"8ae74f3f.4b261","type":"debug","z":"c7e84e4f.2fcce","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":679,"y":245,"wires":[]},{"id":"63e7940.44abf6c","type":"Firebirddatabase","z":"","host":"localhost","port":"3050","db":"C:\\NodeRed\\BancoDados\\NODEREDBD.FDB"},{"id":"8c5b38db.78eea8","type":"ui_group","z":"","name":"Default","tab":"1e230577.890d2b","disp":true,"width":"24","collapse":false},{"id":"1e230577.890d2b","type":"ui_tab","z":"","name":"TESTE","icon":"dashboard","order":3,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![Battassini](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Battassini](https://discourse.nodered.org/u/Battassini)\
**Post date:** [9 May 2019 20:31 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/4 "2019-05-09T20:31:54Z")

</div>

Dear.

Does anyone have any tips please?

Thanks

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [9 May 2019 20:44 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/5 "2019-05-09T20:44:13Z")

</div>

Looking at the picture you attached to the OP I wonder if you tried to convert your data to string type before sending it to the UI template node. I don´t know if the UI template node is able to handle buffer data types.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [9 May 2019 20:57 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/6 "2019-05-09T20:57:35Z")

</div>

@Battassini - I see that you've marked this post as 'Urgent'.  
Why is your post more urgent than everyone else's posts??

---

<div class="post-metadata">

**Author:** ![Battassini](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Battassini](https://discourse.nodered.org/u/Battassini)\
**Post date:** [9 May 2019 21:25 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/7 "2019-05-09T21:25:20Z")

</div>

Dear.

I believe everyone is important - but I can take it without problems.

Thanks

---

<div class="post-metadata">

**Author:** ![Battassini](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Battassini](https://discourse.nodered.org/u/Battassini)\
**Post date:** [9 May 2019 21:29 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/8 "2019-05-09T21:29:05Z")

</div>

Andrei I tried to convert to string but I do not know if I did it correctly.

I tried to use the function:

msg.payload = msg.payload.toString();  
return msg;

Unsuccessfully

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [9 May 2019 22:33 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/9 "2019-05-09T22:33:53Z")

</div>

Faking data as below:

```auto
msg.payload = [{
    DATA : "01/01/2019",
    HORA : "23:30",
    SETPOINTAR1 : "AAA",
    SETPOINTAR2 : "BBB",
    TEMPERATURAAR1 : "123",
    TEMPERATURAAR2 : "456"
},
{
    DATA : "02/02/2020",
    HORA : "24:30",
    SETPOINTAR1 : "XXX",
    SETPOINTAR2 : "YYY",
    TEMPERATURAAR1 : "888",
    TEMPERATURAAR2 : "999"
}]

```

Generates:

![r-01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/3e75f44c46d4f6b366e2204f5044000df7aa2592.png)

I think is worth trying to convert the buffers to strings. It is not possible to give you any suggestion on how to do that unless you provide a sample of your payload in text format. You can copy the data from the debug panel by clicking in the icon shown below:

![r-02](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/3c08101ef957b6240d5d335fe1b90826223dee7d.png)

---

<div class="post-metadata">

**Author:** ![Battassini](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Battassini](https://discourse.nodered.org/u/Battassini)\
**Post date:** [10 May 2019 00:40 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/10 "2019-05-10T00:40:47Z")

</div>

Hello Andrei.

I think these are the data

[{"DATA":[51,48,47,48,52,47,50,48,49,57],"HORA":[49,48,58,50,49],"SETPOINTAR1":[51,48,46,48,48],"SETPOINTAR2":[50,50,46,48,48],"TEMPERATURAAR1":[50,55,46,53,48],"TEMPERATURAAR2":[49,55,46,55,48]},{"DATA":[51,48,47,48,52,47,50,48,49,57],"HORA":[49,49,58,50,49],"SETPOINTAR1":[51,50,46,53,53],"SETPOINTAR2":[49,50,46,52,48],"TEMPERATURAAR1":[49,55,46,55,56],"TEMPERATURAAR2":[50,55,46,49,48]},{"DATA":[48,51,47,48,53,47,50,48,49,57],"HORA":[49,49,58,53,56],"SETPOINTAR1":[51,49,46,48,48],"SETPOINTAR2":[50,51,46,48,48],"TEMPERATURAAR1":[50,57,46,53,48],"TEMPERATURAAR2":[52,55,46,55,48]}]

Thanks

 ![Node04](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/0e17943bf83351b98b6f7583bb091acc6db59d91.png)

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [10 May 2019 01:32 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/11 "2019-05-10T01:32:05Z")

</div>

Your dataset got modified when you pasted/copied the data from the debug panel. The data type changed from `buffer` to `array`. I, therefore, would need to do an additional transformation to recover your original dataset.

I did a real quick testing and found out that the function you are looking for is `String.fromCharCode()`; This function will change your buffers into readable strings that are happily acccepted by the UI template node.

I just wonder if there is another kind of query that you could perform in your database to get strings instead of buffers. That would make your life much easier.

Check here: [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/String/fromCharCode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode)

![r-01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/72918646de30132c9b29396243e427b0e69fff5f.png)

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [10 May 2019 02:10 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/12 "2019-05-10T02:10:17Z")

</div>

It took only half an hour to finish the full solution. I suspect that may be easier ways to do this but anyway this is a possible solution. You can discard the first function node (Array to Buffer) since this was added only to fix the copy and paste from your dataset.

 ![s-01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f94eb4475873ad3be35064e0f3be17b2bc7378d9.png)

 ![s-02](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/975cc1c4995063a5d72bd00d1dae39c7b73e1786.png)

Flow:

```auto
[{"id":"dface2e8.633cb","type":"tab","label":"Buffer to String","disabled":false,"info":""},{"id":"4b5dc8f9.3f0028","type":"debug","z":"dface2e8.633cb","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":830,"y":140,"wires":[]},{"id":"a7a03602.ff79a8","type":"ui_template","z":"dface2e8.633cb","group":"58c016f8.563088","name":"Mostra Tabela","order":3,"width":"12","height":"6","format":"<div layout=\"row\" layout-align=\"start center\">\n <span flex><b>Data</b></span> \n <span flex><b>Hora</b></span>\n <span flex><b>Set Point Ar1</b></span> \n <span flex><b>Set Point Ar2</b></span>\n <span flex><b>Temperatura Ar1</b></span>\n <span flex><b>Temperatura Ar2</b></span>\n</div>\n<div layout=\"row\" layout-align=\"start center\" ng-repeat=\"x in msg.payload | limitTo:20\">\n <span flex>{{x.DATA}}</span>\n <span flex style=\"color: green\">{{x.HORA}}</span> \n <span flex style=\"color: red\">{{x.SETPOINTAR1}}</span>\n <span flex>{{x.SETPOINTAR2}}</span>\n <span flex>{{x.TEMPERATURAAR1}}</span>\n <span flex>{{x.TEMPERATURAAR2}}</span>\n \n</div>","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":820,"y":200,"wires":[[]]},{"id":"fb0b1578.82de38","type":"inject","z":"dface2e8.633cb","name":"Dataset","topic":"","payload":"[{\"DATA\":[51,48,47,48,52,47,50,48,49,57],\"HORA\":[49,48,58,50,49],\"SETPOINTAR1\":[51,48,46,48,48],\"SETPOINTAR2\":[50,50,46,48,48],\"TEMPERATURAAR1\":[50,55,46,53,48],\"TEMPERATURAAR2\":[49,55,46,55,48]},{\"DATA\":[51,48,47,48,52,47,50,48,49,57],\"HORA\":[49,49,58,50,49],\"SETPOINTAR1\":[51,50,46,53,53],\"SETPOINTAR2\":[49,50,46,52,48],\"TEMPERATURAAR1\":[49,55,46,55,56],\"TEMPERATURAAR2\":[50,55,46,49,48]},{\"DATA\":[48,51,47,48,53,47,50,48,49,57],\"HORA\":[49,49,58,53,56],\"SETPOINTAR1\":[51,49,46,48,48],\"SETPOINTAR2\":[50,51,46,48,48],\"TEMPERATURAAR1\":[50,57,46,53,48],\"TEMPERATURAAR2\":[52,55,46,55,48]}]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":140,"wires":[["6f1c4c23.de87c4"]]},{"id":"be6e81b6.1d5e5","type":"function","z":"dface2e8.633cb","name":"Array to Buffer","func":"msg.payload.DATA = Buffer.from(msg.payload.DATA);\nmsg.payload.SETPOINTAR1 = Buffer.from(msg.payload.SETPOINTAR1);\nmsg.payload.SETPOINTAR2 = Buffer.from(msg.payload.SETPOINTAR2);\nmsg.payload.TEMPERATURAAR1 = Buffer.from(msg.payload.TEMPERATURAAR1);\nmsg.payload.TEMPERATURAAR2 = Buffer.from(msg.payload.TEMPERATURAAR2);\n\nreturn msg;","outputs":1,"noerr":0,"x":360,"y":140,"wires":[["51d4b67f.a9ddc8"]]},{"id":"6f1c4c23.de87c4","type":"split","z":"dface2e8.633cb","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":210,"y":140,"wires":[["be6e81b6.1d5e5"]]},{"id":"51d4b67f.a9ddc8","type":"function","z":"dface2e8.633cb","name":"Buffer to String","func":"msg.payload.DATA = String.fromCharCode(...msg.payload.DATA);\nmsg.payload.HORA = String.fromCharCode(...msg.payload.HORA);\nmsg.payload.SETPOINTAR1 = String.fromCharCode(...msg.payload.SETPOINTAR1);\nmsg.payload.SETPOINTAR2 = String.fromCharCode(...msg.payload.SETPOINTAR2);\nmsg.payload.TEMPERATURAAR1 = String.fromCharCode(...msg.payload.TEMPERATURAAR1);\nmsg.payload.TEMPERATURAAR2 = String.fromCharCode(...msg.payload.TEMPERATURAAR2);\n\nreturn msg;","outputs":1,"noerr":0,"x":540,"y":140,"wires":[["ec3f1284.bb2f1"]]},{"id":"ec3f1284.bb2f1","type":"join","z":"dface2e8.633cb","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":690,"y":140,"wires":[["4b5dc8f9.3f0028","a7a03602.ff79a8"]]},{"id":"58c016f8.563088","type":"ui_group","z":"","name":"G1","tab":"e09ece59.1c9fa","disp":false,"width":"12","collapse":false},{"id":"e09ece59.1c9fa","type":"ui_tab","z":"","name":"TAB1","icon":"dashboard"}]

```

---

<div class="post-metadata">

**Author:** ![Battassini](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Battassini](https://discourse.nodered.org/u/Battassini)\
**Post date:** [10 May 2019 20:00 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/13 "2019-05-10T20:00:25Z")

</div>

Dear Andrei.

Congratulations, it worked perfectly.

Thank you very much for your help was very important.

Thank you very much

---

<div class="post-metadata">

**Author:** ![Battassini](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Battassini](https://discourse.nodered.org/u/Battassini)\
**Post date:** [14 May 2019 17:52 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/14 "2019-05-14T17:52:44Z")

</div>

Dear Andrei.  
How are you?  
Please do you have any idea how to deploy this or did it at some point?  
I'll try to explain:  
I have a login screen and password in HTTP. This works validation. But how to call after the validation of the password and login the TAB Flow?  
For example call: [http://127.0.0.1:1880/ui/#!/0](http://127.0.0.1:1880/ui/#!/0)  
Do you have any idea?

Thanks.

---

<div class="post-metadata">

**Author:** ![Battassini](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Battassini](https://discourse.nodered.org/u/Battassini)\
**Post date:** [14 May 2019 17:55 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/15 "2019-05-14T17:55:44Z")

</div>

```auto
[{"id":"dd14667a.96b768","type":"tab","label":"Flow 5","disabled":false,"info":""},{"id":"a5aaf7de.3d8188","type":"http in","z":"dd14667a.96b768","name":"","url":"/login","method":"get","upload":false,"swaggerDoc":"","x":69,"y":128,"wires":[["e264e135.f2b5d"]]},{"id":"e264e135.f2b5d","type":"template","z":"dd14667a.96b768","name":"login-page","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n <meta name=\"description\" content=\"\">\n <meta name=\"author\" content=\"\">\n <link rel=\"icon\" href=\"/Logo_T.png\">\n\n <title>Battassini - Automação e Soluções Industriais</title>\n\n <!-- Bootstrap core CSS -->\n <link href=\"https://getbootstrap.com/docs/4.1/dist/css/bootstrap.min.css\" rel=\"stylesheet\">\n\n <!-- Custom styles for this template -->\n <link href=\"https://getbootstrap.com/docs/4.1/examples/sign-in/signin.css\" rel=\"stylesheet\">\n <script type=\"text/javascript\"></script><link rel=\"stylesheet\" type=\"text/css\" href=\"https://getbootstrap.com/B1D671CF-E532-4481-99AA-19F420D90332/netdefender/hui/ndhui.css\" /></head>\n\n <body class=\"text-center\"><script type=\"text/javascript\" language=\"javascript\" src=\"https://getbootstrap.com/B1D671CF-E532-4481-99AA-19F420D90332/netdefender/hui/ndhui.js?0=0&0=0&0=0\"></script>\n <form class=\"form-signin\" method=\"post\">\n <img class=\"mb-2\" src=\"/Logo_T.png\" alt=\"\" width=\"80\" height=\"100\">\n <h1 class=\"h3 mb-3 font-weight-normal\">Sistema de Monitoramento Remoto</h1>\n <label for=\"inputEmail\" class=\"sr-only\">Username</label>\n <input type=\"text\" id=\"inputEmail\" class=\"form-control\" name=\"username\" placeholder=\"Usuário\" required autofocus>\n <label for=\"inputPassword\" class=\"sr-only\">Password</label>\n <input type=\"password\" id=\"inputPassword\" class=\"form-control\" name=\"password\" placeholder=\"Senha\" required>\n <div class=\"checkbox mb-3\">\n <label>\n <input type=\"checkbox\" value=\"remember-me\"> Lembrar Senha\n </label>\n </div>\n <button class=\"btn btn-lg btn-primary btn-primary\" type=\"submit\">Entrar</button>\n <button class=\"btn btn-lg btn-primary btn-success\" type=\"submit\">Registrar</button>\n <p class=\"mt-3 mb-3 text-muted\">&copy; <script>document.write(new Date().getFullYear());</script> Battassini Automação e Soluções Industriais</p>\n </form>\n </body>\n</html>","output":"str","x":299,"y":128,"wires":[["fd27d5b9.28eab8"]]},{"id":"eae76d28.29b1f","type":"function","z":"dd14667a.96b768","name":"check","func":"var usuario = msg.payload.username;\nvar senha = msg.payload.password;\n\nif ((usuario == 'teste') && (senha == 'teste'))\n{\n msg.payload = \"OK\";\n}\nelse\n{\n msg.payload = \"Erro\";\n}\nreturn msg;","outputs":1,"noerr":0,"x":242,"y":200,"wires":[["24ae7a8d.fcb1e6"]]},{"id":"fd27d5b9.28eab8","type":"http response","z":"dd14667a.96b768","name":"","statusCode":"","headers":{},"x":517,"y":129,"wires":[]},{"id":"42c830d9.7792f","type":"http in","z":"dd14667a.96b768","name":"","url":"/login","method":"post","upload":false,"swaggerDoc":"","x":81,"y":197,"wires":[["eae76d28.29b1f"]]},{"id":"24ae7a8d.fcb1e6","type":"switch","z":"dd14667a.96b768","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"OK","vt":"str"},{"t":"eq","v":"Erro","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":397,"y":198,"wires":[["b550bee7.5c81"],[]]},{"id":"b550bee7.5c81","type":"function","z":"dd14667a.96b768","name":"Cycle","func":"//msg.payload = {\"ui\" : 'http://127.0.0.1:1880/ui/#!/0'};\nmsg.payload = {\"ui\": \"http://127.0.0.1:1880/ui/#!/0\" };\n\nreturn msg;\n\n\n\n","outputs":1,"noerr":0,"x":666,"y":194,"wires":[["1cf46d82.0b7212","f653b1ad.cd1ee"]]},{"id":"1cf46d82.0b7212","type":"ui_ui_control","z":"dd14667a.96b768","name":"","x":911,"y":197,"wires":[[]]},{"id":"f653b1ad.cd1ee","type":"debug","z":"dd14667a.96b768","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":889,"y":254,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [15 May 2019 11:57 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/16 "2019-05-15T11:57:39Z")

</div>

Hi Battassini,

If I understood correctly you want that users are redirected to a dashboard tab when they log in using the customized page you designed.  
I don´t think it is possible to make it work with the ui\_control node. This node will not command your browser in such a way.

I would suggest that you open a new topic in this forum so you can get your questions to a broader audience. There are quite a lot of people more experienced in HTML that can provide some insights.

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [16 May 2019 18:38 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/17 "2019-05-16T18:38:11Z")

</div>

I stumbled upon this post while searching for something else...

> [@Url redirect when clicking a button](https://discourse.nodered.org/t/url-redirect-when-clicking-a-button/1347):
>
> Hi, I want to create a button in the dashboard that when the user clicks it he is redirected in the browser to the webpage [http://127.0.0.1:1880/configCamera](http://127.0.0.1:1880/configCamera). I also want to be able to append to this url something like “?name=‘name’”, where ‘name’ can be modified. So far I tried to use http request, but I just get the response in a json.

Perhaps it can bu useful for your purpose.

---

<div class="post-metadata">

**Author:** ![Battassini](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@Battassini](https://discourse.nodered.org/u/Battassini)\
**Post date:** [17 May 2019 12:06 UTC](https://discourse.nodered.org/t/ui-template-database-help/10928/18 "2019-05-17T12:06:28Z")

</div>

Dear Andrei.

Thanks for the Post I'm really going to follow the HTML side.

Thank you very much
