# Can't append JQuery fetch result in Dropdown Box in HTML nodeRED

**URL:** <https://discourse.nodered.org/t/cant-append-jquery-fetch-result-in-dropdown-box-in-html-nodered/44365>\
**Category:** Developing Nodes\
**Created:** [18 April 2021 19:31 UTC](https://discourse.nodered.org/t/cant-append-jquery-fetch-result-in-dropdown-box-in-html-nodered/44365 "2021-04-18T19:31:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarthak7034](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sarthak7034/32/40258_2.png) [@sarthak7034](https://discourse.nodered.org/u/sarthak7034)\
**Post date:** [18 April 2021 19:31 UTC](https://discourse.nodered.org/t/cant-append-jquery-fetch-result-in-dropdown-box-in-html-nodered/44365/1 "2021-04-18T19:31:02Z")

</div>

I am fetching results using JQuery, I can see the results on the console but can't push it into the dropdown box.

```auto
   <script type="text/javascript">
    
        RED.nodes.registerType('uni-red',{
            category: 'Network',
            color: '#baff97',
            defaults: {
            name: {value:""},
            outputs: {value: 1}
            },
            inputs:1,
            outputs:1,
            icon: "Cute-Ball-Go-icon.png",
            label: function() {
                        return this.name || "uni-red";
                    },
            labelStyle: function() {
                    return this.name?"node_label_italic":"";
                },
            oneditprepare: function() {
                let url_base ='http://localhost:8080'
                const node = this $.getJSON('http://localhost:8080/service/fa81c7a/TemperatureController/property/CurrentTemperature', 
         function(data){
                     const newOp = (`<option>${data}</option>`)
                      $("#node-input-operation").append(newOp)
        })
        },

    }
    
);
</script>

```

After this I have my normal HTML tags in place.

---

<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:** [18 April 2021 19:40 UTC](https://discourse.nodered.org/t/cant-append-jquery-fetch-result-in-dropdown-box-in-html-nodered/44365/2 "2021-04-18T19:40:27Z")

</div>

What is in `data`? I imagine it's an object since you are calling getJSON.

Example...

```auto
$("#node-input-operation").append(`<option value="${data.value}">${data.text}</option>`); 

```

---

<div class="post-metadata">

**Author:** ![sarthak7034](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sarthak7034/32/40258_2.png) [@sarthak7034](https://discourse.nodered.org/u/sarthak7034)\
**Post date:** [19 April 2021 07:33 UTC](https://discourse.nodered.org/t/cant-append-jquery-fetch-result-in-dropdown-box-in-html-nodered/44365/3 "2021-04-19T07:33:51Z")

</div>

So, on my console I am getting an UUID number from the .get function. Also Can I use node.send() somehow to show the result on nodeRED from script tag?

---

<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:** [18 June 2021 07:34 UTC](https://discourse.nodered.org/t/cant-append-jquery-fetch-result-in-dropdown-box-in-html-nodered/44365/4 "2021-06-18T07:34:37Z")

</div>

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