# How to use OPCUA Browser and Template nodes together \[SOLVED\]

**URL:** <https://discourse.nodered.org/t/how-to-use-opcua-browser-and-template-nodes-together-solved/9937>\
**Category:** General\
**Created:** [9 April 2019 10:21 UTC](https://discourse.nodered.org/t/how-to-use-opcua-browser-and-template-nodes-together-solved/9937 "2019-04-09T10:21:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sajidb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sajidb/32/8812_2.png) [@sajidb](https://discourse.nodered.org/u/sajidb)\
**Post date:** [9 April 2019 10:21 UTC](https://discourse.nodered.org/t/how-to-use-opcua-browser-and-template-nodes-together-solved/9937/1 "2019-04-09T10:21:30Z")

</div>

I want to connect to OPCUA server and get the data on the dashboard. For the solution, I am using OPCUA Browser node and the template node.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/cb248c15dc04e13fb3eb8fd234fe12682b97df50.png)  
But I don't know how to browse the data.  
I am using the following code for template:

```auto
<div layout="row" layout-align="space-between">
	<select ng-model="item" ng-options="items.item.displayName.text for items in msg.payload">
		<option value="">-- Objects Root --</option>
	</select>
	<button ng-click="send({payload: {actiontype: 'browse', root: item}})"> Browse </button>
</div>

<div layout="row" layout-align="space-between">
    <ul> <li ng-repeat="items in msg.payload"> {{items.item.displayName.text}}: {{items.item.nodeId}} </li>
    </ul>
</div>

```

When I deploy it, my node-red server connection gets lost and I get this error message:

- [warn] [OpcUa-Browser:72907975.5a3ce8] input browser
- [info] [OpcUa-Browser:72907975.5a3ce8] start browse client on opc.tcp://10.61.145.44:4050

Then I have to delete the backup flow nad then restart node-red in order to run it again. I need some help regarding this. Thanks.

Solved. I found the solution.

---

<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:** [7 May 2019 08:58 UTC](https://discourse.nodered.org/t/how-to-use-opcua-browser-and-template-nodes-together-solved/9937/2 "2019-05-07T08:58:23Z")

</div>

> [@sajidb](#):
>
> Solved. I found the solution

Can you please post a copy of your work? I'm sure others could use it.

---

<div class="post-metadata">

**Author:** ![sajidb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sajidb/32/8812_2.png) [@sajidb](https://discourse.nodered.org/u/sajidb)\
**Post date:** [9 May 2019 16:58 UTC](https://discourse.nodered.org/t/how-to-use-opcua-browser-and-template-nodes-together-solved/9937/3 "2019-05-09T16:58:26Z")

</div>

I have used the example of mikakaraila available on github as node-red-contrib-opcua library. The example flow code is:

```auto
[{"id":"a24729d8.6e3338","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"a5c3b771.b035f","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false},{"id":"57e89fdc.43d9e","type":"ui_group","z":"","name":"Default","tab":"a5c3b771.b035f","disp":true,"width":"6","collapse":false},{"id":"30bfcadd.1595b6","type":"OpcUa-Endpoint","z":"","endpoint":"opc.tcp://TREL16087112.vstage.co:53530/OPCUA/SimulationServer","secpol":"None","secmode":"NONE","login":false},{"id":"9a453441.d77cc","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":false},"group-textColor":{"value":"#1bbfff","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#0094ce","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey"}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","lockMenu":"false","allowTempTheme":"true","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"715ed404.79906c","type":"ui_template","z":"a24729d8.6e3338","group":"57e89fdc.43d9e","name":"Browse","order":0,"width":"6","height":"11","format":"<div layout=\"row\" layout-align=\"space-between\">\n <select ng-model=\"item\" ng-options=\"items.item.displayName.text for items in msg.payload\">\n <option value=\"\">-- Objects Root --</option>\n </select>\n <button ng-click=\"send({payload: {actiontype: 'browse', root: item}})\">\n Browse\n </button>\n</div>\n<div layout=\"row\" layout-align=\"space-between\">\n <ul>\n <li ng-repeat=\"items in msg.payload\">\n {{items.item.displayName.text}}: {{items.item.nodeId}}\n </li>\n </ul>\n</div>\n","storeOutMessages":true,"fwdInMessages":false,"templateScope":"local","x":250.49998474121094,"y":81.80000305175781,"wires":[["3da8dc2e.9c9f3c","1a39131f.0bb62d"]]},{"id":"3da8dc2e.9c9f3c","type":"ui_toast","z":"a24729d8.6e3338","position":"top right","displayTime":"2","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"Browsing...","name":"Action","x":471.49998474121094,"y":82.59999084472656,"wires":[]},{"id":"1a39131f.0bb62d","type":"OpcUa-Browser","z":"a24729d8.6e3338","endpoint":"30bfcadd.1595b6","item":"","datatype":"","topic":"ns=0;s=85/0:Simulation","items":[],"x":250.9000244140625,"y":187.40000915527344,"wires":[["715ed404.79906c"]]}]

```

Just change the endpoint address and everything will work fine.

The mistake which I was doing is a small mistake but that will make your life much harder.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/117a4176434a5d36cdf6fdaa960c7656158ffc40.png)

Never check this option. If you check it then it will pass the input which results in crashing and stopping your server because there will no input for browser node thus the template node.

---

<div class="post-metadata">

**Author:** ![khadija](https://avatars.discourse-cdn.com/v4/letter/k/6f9a4e/32.png) [@khadija](https://discourse.nodered.org/u/khadija)\
**Post date:** [7 July 2021 09:15 UTC](https://discourse.nodered.org/t/how-to-use-opcua-browser-and-template-nodes-together-solved/9937/4 "2021-07-07T09:15:49Z")

</div>

hey, i have one more question please, how can I use this template to browse with OPC UA Client not OPC UA Browser. thanke you in advance.

---

<div class="post-metadata">

**Author:** ![sajidb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sajidb/32/8812_2.png) [@sajidb](https://discourse.nodered.org/u/sajidb)\
**Post date:** [7 July 2021 10:08 UTC](https://discourse.nodered.org/t/how-to-use-opcua-browser-and-template-nodes-together-solved/9937/6 "2021-07-07T10:08:08Z")

</div>

The template is just a node that uses HTML formatting. I don't think we need a Template node with the OPC UA client since the OPCUA client is built to connect to the server and get you the payload.  
According to my understanding, if you need some custom modification then you should do it in the OPC UA Browser node.

---

<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:** [7 July 2021 10:18 UTC](https://discourse.nodered.org/t/how-to-use-opcua-browser-and-template-nodes-together-solved/9937/7 "2021-07-07T10:18:06Z")

</div>

@khadija could you start a new thread an include details of your issue. Link back to this thread if it helps.

Closing this 2y old thread.

---

<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:** [7 July 2021 10:19 UTC](https://discourse.nodered.org/t/how-to-use-opcua-browser-and-template-nodes-together-solved/9937/8 "2021-07-07T10:19:07Z")

</div>


