# Fill editor values from node function

**URL:** <https://discourse.nodered.org/t/fill-editor-values-from-node-function/65982>\
**Category:** Developing Nodes\
**Tags:** editor\
**Created:** [3 August 2022 15:35 UTC](https://discourse.nodered.org/t/fill-editor-values-from-node-function/65982 "2022-08-03T15:35:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dionmes](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dionmes/32/65626_2.png) [@dionmes](https://discourse.nodered.org/u/dionmes)\
**Post date:** [3 August 2022 15:35 UTC](https://discourse.nodered.org/t/fill-editor-values-from-node-function/65982/1 "2022-08-03T15:35:16Z")

</div>

Hi, I am building a node with bluetooth connectivity. And this all works fine.

But to connect to the bluetooth device you need to enter a bluetooth address, and also first find out what that address is. This can be quite difficult.

So instead I want to have a dropdown in the node config editor to select the bluetooth address populated from a bluetooth scan. I know how to do a scan in the node, however I cannot find how to get that dynamic information in the node config editor. Or run functions in the node.  
I know how to manipulate the config editor HTML with jquery and the "oneditprepare" call. But not how to connect to the node or interacting with it.

Ps. I need to run the BT scan in the node, as running it in the editor HTML/script would mean it would scan from the browser instead of running from the device that node-red runs on.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 August 2022 15:48 UTC](https://discourse.nodered.org/t/fill-editor-values-from-node-function/65982/2 "2022-08-03T15:48:49Z")

</div>

Hi. The usual example we give is the node-red-node-serialport which has a button to fetch the list of available ports from the host.

> **[node-red-nodes/io/serialport at master · node-red/node-red-nodes](https://github.com/node-red/node-red-nodes/tree/master/io/serialport)**
>
> master/io/serialport

---

<div class="post-metadata">

**Author:** ![dionmes](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dionmes/32/65626_2.png) [@dionmes](https://discourse.nodered.org/u/dionmes)\
**Post date:** [3 August 2022 16:53 UTC](https://discourse.nodered.org/t/fill-editor-values-from-node-function/65982/3 "2022-08-03T16:53:14Z")

</div>

Thank you. So I got a bit confused by the RED.nodes.node(this) entries. But I suppose that is just a config reference, not a node reference?

So in the serialports I also found this, so if I implement that, I could do I a request from the config editor and than get the needed values.

RED.httpAdmin.get("/serialports"....

Am I looking in the right direction ?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 August 2022 16:55 UTC](https://discourse.nodered.org/t/fill-editor-values-from-node-function/65982/4 "2022-08-03T16:55:26Z")

</div>

Yes. You need to choose your own endpoint name to call on the server so as not to conflict, but yes the get calls the backend. Then at the backend you can do your scan and return the values you want.

---

<div class="post-metadata">

**Author:** ![dionmes](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dionmes/32/65626_2.png) [@dionmes](https://discourse.nodered.org/u/dionmes)\
**Post date:** [3 August 2022 16:57 UTC](https://discourse.nodered.org/t/fill-editor-values-from-node-function/65982/5 "2022-08-03T16:57:29Z")

</div>

Awesome, thanks.

---

<div class="post-metadata">

**Author:** ![dionmes](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dionmes/32/65626_2.png) [@dionmes](https://discourse.nodered.org/u/dionmes)\
**Post date:** [7 August 2022 08:21 UTC](https://discourse.nodered.org/t/fill-editor-values-from-node-function/65982/6 "2022-08-07T08:21:31Z")

</div>

Result can be found here; [node-red-contrib-soma-smartblinds2 (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-soma-smartblinds2)  
See GitHub for implementation;  
[GitHub - dionmes/node-red-contrib-soma-smartblinds2: Node-Red node for Soma smartblinds 2. Supported Bluetooth needed.](https://github.com/dionmes/node-red-contrib-soma-smartblinds2)

---

<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:** [21 August 2022 08:22 UTC](https://discourse.nodered.org/t/fill-editor-values-from-node-function/65982/7 "2022-08-21T08:22:01Z")

</div>

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