# Cookbook updates

**URL:** <https://discourse.nodered.org/t/cookbook-updates/7948>\
**Category:** News\
**Created:** [13 February 2019 22:23 UTC](https://discourse.nodered.org/t/cookbook-updates/7948 "2019-02-13T22:23:15Z")\
**Posts on this page:** 8\
**Page:** 1

<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:** [13 February 2019 22:23 UTC](https://discourse.nodered.org/t/cookbook-updates/7948/1 "2019-02-13T22:23:15Z")

</div>

I've spent the last couple of days adding recipes to the [Cookbook](https://cookbook.nodered.org).

All of the placeholder recipes we had in the list now exist, plus a couple more along the way.

I've also created a Node-RED Project that contains all of the recipes: [https://github.com/node-red/cookbook-flows](https://github.com/node-red/cookbook-flows) that you can clone into your local Node-RED. Admittedly its more there for us maintain the cookbook, but I'm sure it'll be of use to some of you.

As you can see, we're focussed on covering the most common patterns before getting too advanced. My hope is, as questions get asked here on 'how can I do XYZ?' we're able to point at particular recipes rather than provide the same answers again and again. We should also use the insight of what gets asked regularly to consider what recipes we should have.

If you have any suggestions for common patterns we should cover, then please do let us know. Comment here, or come join the #docs channel on [slack](https://nodered.org/slack). For example, I plan to add one on joining separate streams of messages into one as that comes up a lot on here.

And whilst it's focussed on the core nodes, I'm sure we'll expand to have some Dashboard recipes at some point.

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [14 February 2019 00:09 UTC](https://discourse.nodered.org/t/cookbook-updates/7948/2 "2019-02-14T00:09:25Z")

</div>

Hi Nick, please have a look on the flow for [this one](https://cookbook.nodered.org/basic/report-by-exception) (does not match with picture)

---

<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:** [14 February 2019 00:14 UTC](https://discourse.nodered.org/t/cookbook-updates/7948/3 "2019-02-14T00:14:39Z")

</div>

@Andrei - thanks. Fixed.

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [14 February 2019 00:16 UTC](https://discourse.nodered.org/t/cookbook-updates/7948/4 "2019-02-14T00:16:56Z")

</div>

please check [this one too](https://cookbook.nodered.org/basic/convert-json) Nick.

---

<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:** [14 February 2019 00:22 UTC](https://discourse.nodered.org/t/cookbook-updates/7948/5 "2019-02-14T00:22:19Z")

</div>

Also fixed. Have quickly checked the others, don't think I've missed any others. Its been a long day of updating 30 documents/flows/images.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [14 February 2019 04:01 UTC](https://discourse.nodered.org/t/cookbook-updates/7948/6 "2019-02-14T04:01:14Z")

</div>

Brilliant. Thanks Nick, a really nice job.

Any interest in this recipe, or is it too exotic?

Search and replace in a string (using `split` and `join` nodes)

 ![search_replace](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/fe92063bd89d940984156eb63c9a86fb302f5945.png)

```auto
[{"id":"a4671335.51319","type":"split","z":"646f6b5.a3ebf94","name":"split (search)","splt":"search","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":300,"y":90,"wires":[["fd1dd091.3a3fa8"]]},{"id":"540bb959.84731","type":"inject","z":"646f6b5.a3ebf94","name":"input","topic":"","payload":"first-search-last","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":90,"wires":[["a4671335.51319","78a3cd61.307b74"]]},{"id":"fd1dd091.3a3fa8","type":"join","z":"646f6b5.a3ebf94","name":"join (replace)","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"replace","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":460,"y":90,"wires":[["a3382fb4.8fb9e"]]},{"id":"a3382fb4.8fb9e","type":"debug","z":"646f6b5.a3ebf94","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":620,"y":90,"wires":[]},{"id":"78a3cd61.307b74","type":"debug","z":"646f6b5.a3ebf94","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":300,"y":130,"wires":[]}]

```

---

<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:** [14 February 2019 08:47 UTC](https://discourse.nodered.org/t/cookbook-updates/7948/7 "2019-02-14T08:47:48Z")

</div>

@drmibell whilst a clever technique, we would prioritise the more explainable solution to such a problem - in this case, a single Change node set to change the payload:

```auto
[{"id":"860dc495.5d4518","type":"inject","z":"535331d8.55c1f","name":"input","topic":"","payload":"first-search-last","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":580,"wires":[["12af6009.402d9"]]},{"id":"12af6009.402d9","type":"change","z":"535331d8.55c1f","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"search","fromt":"str","to":"replace","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":580,"wires":[["18a27dd1.da8402"]]},{"id":"18a27dd1.da8402","type":"debug","z":"535331d8.55c1f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":520,"y":580,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [14 February 2019 18:47 UTC](https://discourse.nodered.org/t/cookbook-updates/7948/8 "2019-02-14T18:47:49Z")

</div>

> [@knolleary](#):
>
> prioritise the more explainable solution

Of course. Just having some fun.

On the other hand, this will give the number occurrences of a substring... 🙂

 ![occurrences](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d6b04477f44bdb9794927219fbdc2f00402ca78f.png)

```auto
[{"id":"860dc495.5d4518","type":"inject","z":"535331d8.55c1f","name":"input","topic":"","payload":"first-search-last","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":580,"wires":[["12af6009.402d9"]]},{"id":"12af6009.402d9","type":"change","z":"535331d8.55c1f","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"search","fromt":"str","to":"replace","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":580,"wires":[["18a27dd1.da8402"]]},{"id":"18a27dd1.da8402","type":"debug","z":"535331d8.55c1f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":520,"y":580,"wires":[]}]

```
