Feature request: Find and Replace / Better Search

Now that I've got more and more flows within Node RED, it would be nice if there was an option to replace items within the UI.

For example, my use of NR is primarily for automation with Home Assistant. If I change something in my HA configuration that changes an entity name, I have to manually update all of the flows.

  1. Copy the entity I want to find and replace to clipboard
  2. Open search
  3. Search to find those entities
  4. Double click to be taken to the place where the node is located that is using that entity
  5. I hope I notice which one it is when it blinks, as on a big monitor/high res screen, you have a lot on the screen. Otherwise rinse and repeat from 2.
  6. Double click on that node to open the edit panel
  7. Copy the new entity name that I want to use (assuming it's something that's significantly different)
  8. Paste the new entity name
  9. Save
  10. Start back at 1 for the next one

This is perfectly fine if you are doing 1-10, but if you have more than that, it's a big PITA and a massive time suck. I know there are hacky things you can do like bring down NR and edit the JSON file, but that's definitely not my preferred option.

Some suggestions that could be implemented:

  • Have search be in a sidebar that covers over the left nodes bar as when you are searching you do not need to access the nodes to drag/drop
  • Only reseat the search params when the user clears them
  • Limit search to just current tab or all tabs
  • Implement basic find, find next, replace, replace all
  • Implement more advanced options like case sensitivity, whole word, and regex searching
  • Improve highlighting of the nodes containing the found term. Maybe darken/fade out the irrelevant nodes or significantly increase the flashing border size.

A lot of these are pretty standard search options available in most IDEs (including web based Ace). Adding these would make search a first class citizen of Node RED.

4 Likes

Thanks for the feedback. Lots of good ideas there.

There is an item on the backlog for adding a new sidebar panel that gives a structured tree view of your flows/subflows/nodes. Adding a search filter to that would, I think, address lot of your points.

What I have done and it seems to work on my flows is to export the entire flow or flows, open in a text editor and then do a search and replace. I have no way of knowing how big my flow is compared to others and this isn't to say a built in search and replace isn't a good idea but it does seem to be a work around for me.

That sounds like a great solution!

I think you can also shut down NR and manually edit the JSON, but that’s introducing more risk than I’d like.

1 Like

I'd also like to see a persistent search results box - when making a global change to say a topic that's used in may flows having to start the search from scratch each time is a pain. If the search results box were floating and had a 'pin' icon to keep it open that would be a great improvement.

2 Likes

Hi gerry, @knolleary, @poldim,
I'm quite new to Node-Red and use it in combination with am homematic-house automation system.
Just for the same reason this post was opened by poldim I would be very glad to to see an "find and replace" option, so that you can search all nodes in the active flow / in all flows for a string and replace it by another.
Of course, how gerry wrote it is possible to use an external editor ... but I think that it would be much more user-friendly, making the changes wihtin Node-Red.
So my question is: Is there an official site to post an feature request? Are ther any counters, how many people like to have the different features? Or is it just ok to post it here in the forum and someday it appears in the changelog?
Best wishes
Joe

Hi @JoeWiseman

this forum is the right place to start with a feature request - so we can discuss it and consider whether its something that fits in Node-RED.

Often the suggestions will already exist in some form on the backlog. If there is something genuinely new worth capturing then we'll add it to the backlog.

It will then sit there until either someone is sufficiently motivated to contribute, or it gets prioritised into what I'm working on.

From the original post, there are two separate ideas here. One is having a better search UX - where the search results stay open and let you browse through them. As I mentioned in my reply, I think that is largely covered by the new sidebar coming soon - https://github.com/node-red/designs/tree/outliner/designs/flow-outliner

The other item, which you are interested in, is the ability to quickly mass-edit nodes by doing a search/replace of text. I've now added that to the backlog - but would require quite a lot of design work to get the user experience right as it doesn't really fit with the edit model we have.

1 Like

Hii @knolleary,
thanks for explaining the mechanism of new features in such a detail!
So, I'll hope that many people will need the mentioned improvement of the search/replace feature ... and of course that there is someone who will implement it :wink:
Again, thanks a lot!!!

Hello, I was also searching for search replace in the node properties and came to this post… I don’t know the status about this in the last nodered version. I imagine that if it would available, there would be a message here closing this post.

Some additional ideas on this could be the following proposal:
If I want to duplicate some flow ( or subset of nodes) and import them but instantiate them to work on different variables, a nice tool could be the following : ( this is something I have seen in some great PLC IDE)
Add in the import window the possibility to define multiple search replace rules that would apply to the json code before import.

To make it easy, the search replace definition could be a json object where keys are text to search and values are text to replace.
Example
{ ´_Z1´: ´_Z2´, ´Zone 1´ : ´Zone 2´}
A checkbox in the import pop up would allow to activate this function.

I know that subflow allow to duplicate code easily but their debugging become sometime more difficult so duplicating / instancing multiple times the same code is sometimes easier.

One other Idea is the search on the sidebar, beacuse if i have lots of debug i can't search it with words

Hi both, this thread is 2 years old now and search has moved on a lot since then.

It would be better to create a new thread.