# Remote Update Single Tab of Flow

**URL:** https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758
**Category:** General
**Created:** [20 March 2023 15:09 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758 "2023-03-20T15:09:25Z")
**Posts on this page:** 15
**Page:** 3

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [3 April 2023 09:15 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758/42 "2023-04-03T09:15:37Z")

</div>

What is that eth-ip node, node-red-contrib-something possibly.

On the post flow issue, did you try posting the data that you got when you did a GET of the same tab id?

---

<div class="post-metadata">

### Author: ![ChZeman](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChZeman](https://discourse.nodered.org/u/ChZeman)
#### Post date: [3 April 2023 11:08 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758/43 "2023-04-03T11:08:39Z")

</div>

Yes.

> **[node-red-contrib-cip-ethernet-ip](https://flows.nodered.org/node/node-red-contrib-cip-ethernet-ip)**
>
> A Node-RED node to interact with Allen Bradley / Rockwell PLCs using the EtherNet/IP Protocol

I posted the exact data I received from the GET and it still failed. If it failed, I received an error message in the response from NR ("can't post flow", "missing nodes property," etc.). Most of the time it would respond with the node id as expected. Knolleary didn’t point anything out I was doing wrong (I posted the commands I tried) so I'm guessing at least one of my commands was correct. All I can figure is I'm not being clear on what I'm trying to do and everyone thinks I'm trying to do something similar but different and NR isn't actually capable of doing what I'm trying to have it do. I can deploy an entire flow just fine, but I want to re-deploy just a single tab and leave the others alone.

Environment variables are a better approach anyways, but that might not be possible either with ST-One's nodes.

---

<div class="post-metadata">

### Author: ![yOyOeK1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/yoyoek1/32/73011_2.png) [@yOyOeK1](https://discourse.nodered.org/u/yOyOeK1)
#### Post date: [3 April 2023 11:20 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758/44 "2023-04-03T11:20:39Z")

</div>

You all ready read some on my repository. Can we continue some with getting from you some feedback?

Or you have solution and Ciach DONE?

---

<div class="post-metadata">

### Author: ![ChZeman](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChZeman](https://discourse.nodered.org/u/ChZeman)
#### Post date: [3 April 2023 11:32 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758/45 "2023-04-03T11:32:00Z")

</div>

I provided feedback in comment 17. I've visited your repo several times and was royally confused. I think you did a great job on putting together your collection of programs that works well for your needs. You told me odtm-tools would do exactly what I couldn't figure out how to install just that component. It looked like I needed to install a bunch of other things on the Pis and an Android device.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [3 April 2023 12:24 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758/46 "2023-04-03T12:24:10Z")

</div>

> [@ChZeman](#):
>
> I posted the exact data I received from the GET and it still failed.

Run the get and feed it into a debug node. Then in that debug node use the Copy Value button to copy it, and paste the into a debug node set to be configured with JSON. That will give you a debug node with what should be valid data. Then feed that into your flow that does the PUT. If that doesn't work, then export those nodes and paste them here so we can try it.

---

<div class="post-metadata">

### Author: ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)
#### Post date: [3 April 2023 12:36 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758/47 "2023-04-03T12:36:34Z")

</div>

> [@ChZeman](#):
>
> `curl --header "Content-Type: application/json" --request POST --data '{"id":"f72d85c5e090800f","type":"tab","label":"Test","nodes":"${TEST}","configs":[],"subflows":[]}' -H "Authorization: Bearer ${TOKEN}" -X PUT http://${IP}:1880/flow/f72d85c5e090800f`

in the curl command that you shared in post 33  
you have the parameter `--request POST` and then `-X PUT`  
i dont know what takes precedence with curl but  
for updating a flow its a PUT method so remove `--request POST`

I tested the command on a virtual test machine and it works fine.  
If the id of the flow you want to update is `f72d85c5e090800f` try the simplest test  
(an inject and debug node)

```auto
curl --location --request PUT 'http://192.168.0.10:1880/flow/f72d85c5e090800f' \
--header 'Content-Type: application/json' \
--data '{
    "id": "f72d85c5e090800f",
    "label": "TEST 1",
    "nodes": [
        {
            "id": "abbed8844a2db61",
            "type": "inject",
            "z": "b6fc9dc98a231f5a",
            "name": "test1",
            "props": [
                {
                    "p": "payload"
                },
                {
                    "p": "topic",
                    "vt": "str"
                }
            ],
            "repeat": "",
            "crontab": "",
            "once": false,
            "onceDelay": 0.1,
            "topic": "",
            "payload": "",
            "payloadType": "date",
            "x": 220,
            "y": 120,
            "wires": [
                [
                    "d59b1fc7011ef7f3"
                ]
            ]
        },
        {
            "id": "d59b1fc7011ef7f3",
            "type": "debug",
            "z": "b6fc9dc98a231f5a",
            "name": "debug 1",
            "active": true,
            "tosidebar": true,
            "console": false,
            "tostatus": false,
            "complete": "false",
            "statusVal": "",
            "statusType": "auto",
            "x": 430,
            "y": 120,
            "wires": []
        }
    ],
    "configs": []
}'

```

ps .  
add your Authorization headers,  
change to your server ip  
backup your flows if you have important information.

---

<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: [3 April 2023 13:10 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758/48 "2023-04-03T13:10:03Z")

</div>

> [@ChZeman](#):
>
> I would really have preferred using environment variables but it doesn't appear ST-One's node's support them. I hope I'm wrong because I'm stuck doing updates the long way (about 50 pieces of equipment, more in the future) if they don't

Even if a flow edit dialog is not developed to support ENV vars, you can simply substitute them in the flow JSON. e.g. support the flow JSON is `{ "send-payload": true }` you can POST or PUT `{ "send-payload": ${send_payload_bool_option} }`

> [@ChZeman](#):
>
> As far as updating individual tabs, I give up. The documentation IS lacking on that front.

Did you follow the docs and example for updating a single flow tab?  
[https://nodered.org/docs/api/admin/methods/put/flow/](https://nodered.org/docs/api/admin/methods/put/flow/)

What info is missing?

---

<div class="post-metadata">

### Author: ![ChZeman](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChZeman](https://discourse.nodered.org/u/ChZeman)
#### Post date: [3 April 2023 13:18 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758/49 "2023-04-03T13:18:02Z")

</div>

> Even if a flow edit dialog is not developed to support ENV vars, you can simply substitute them in the flow JSON. e.g. support the flow JSON is `{ "send-payload": true }` you can POST or PUT `{ "send-payload": ${send_payload_bool_option} }`

Good to know. I'll have to check that out. Thank you!

Thank you!!! So there was, in fact, an error in my command. I see it now.

---

<div class="post-metadata">

### Author: ![ChZeman](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChZeman](https://discourse.nodered.org/u/ChZeman)
#### Post date: [3 April 2023 13:22 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758/50 "2023-04-03T13:22:39Z")

</div>

> Even if a flow edit dialog is not developed to support ENV vars, you can simply substitute them in the flow JSON. e.g. support the flow JSON is `{ "send-payload": true }` you can POST or PUT `{ "send-payload": ${send_payload_bool_option} }`

Thank you. That's good to know. I'll have to look at that.

> Did you follow the docs and example for updating a single flow tab?  
> [PUT /flow/:id : Node-RED](https://nodered.org/docs/api/admin/methods/put/flow/)  
> What info is missing?

The authentication page gives specific examples using curl for getting an authentication token. Each page under methods tells you the basic arguments NR is looking for but provides no examples.

---

<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: [3 April 2023 13:50 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758/51 "2023-04-03T13:50:01Z")

</div>

> [@ChZeman](#):
>
> The authentication page gives specific examples using curl for getting an authentication token. Each page under methods tells you the basic arguments NR is looking for but provides no examples.

So can you not extrapolate the CURL command for a `PUT`? All of the info is there, you just need to put it together. There are thousands of examples around the internet.

e.g.

`curl -H 'Content-Type: application/json' -H 'Accept: application/json' -H "Authorization: Bearer <ACCESS_TOKEN>" -X PUT -d '<JSON_FLOW>' http://<IP_HERE>/flow/<FLOW_ID_HERE>`

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [3 April 2023 13:54 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758/52 "2023-04-03T13:54:34Z")

</div>

@ChZeman thanks for the feedback. Adding more working examples to the api docs will be useful.

---

<div class="post-metadata">

### Author: ![ChZeman](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChZeman](https://discourse.nodered.org/u/ChZeman)
#### Post date: [3 April 2023 14:07 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758/53 "2023-04-03T14:07:10Z")

</div>

@Steve-Mcl  
Between a problem that knolleary noticed with my json (which I SHOULD have noticed comparing to the docs) and UnborN supplying a curl example (spotting a problem with the curl commands I had put together), the problem is now solved.

I had attempted many times and posted what I tried. I also found countless posts on the internet from others having the same problem I was but they weren't able to come up with a solution either. When you have that many people struggling with the same thing, it means something needs to be added to the documentation. I'm not saying the documentation is horrible by any means. I've found it helpful in many cases. It just needs working examples to help people understand certain concepts they don't yet understand.

The great thing about IT is that it's an ocean of various technologies that can work together. The bad thing about IT is that none of us will ever grasp all of it and struggling to put things together can be discouraging and a turn-off that steers people a different direction.

---

<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: [3 April 2023 14:11 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758/54 "2023-04-03T14:11:35Z")

</div>

I appreciate that - not everyone can know everything. But also appreciate, every single scenario cannot be documented either. 🤷‍♂️ (I get lost off when there is too much info and it risks going stale / maintenance headache) but examples would be a nice addition.

If you can, a PR to the docs with 1 or 2 working examples would be a great 🤞 .

---

<div class="post-metadata">

### Author: ![ChZeman](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@ChZeman](https://discourse.nodered.org/u/ChZeman)
#### Post date: [3 April 2023 14:20 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758/55 "2023-04-03T14:20:10Z")

</div>

Oh exactly. I do a lot of reading of support posts both here and other sites and see so many cases where the developer responds to support requests with "It's in the docs." Sometimes it is. Sometimes it isn't. "Just read the docs" has become a pet peeve of mine.

That said, I realize there are many people who simply don't read the documentation. I'd rather read the docs and come up with an answer because it'll more often than not be completed faster than receiving a response. Clear, concise documentation is paramount in my line of work. It's not always perfect, but we work to improve it as scenarios come up. The other side of that is the documentation can be there but the operator might need to be walked through a couple times because the equipment and situations CAN be intimidating until you get used to it.

PRs are something I've never done before but I'll look at that. I've seen them talked about. I might know more about them than I realize but I won't know until I check it out. Thanks! 🙂

---

<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: [17 April 2023 14:20 UTC](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758/56 "2023-04-17T14:20:39Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/remote-update-single-tab-of-flow/76758.md?page=2)
