# Filter msg.payload.array and show only new object

**URL:** <https://discourse.nodered.org/t/filter-msg-payload-array-and-show-only-new-object/71641>\
**Category:** General\
**Tags:** uibuilder\
**Created:** [3 December 2022 11:12 UTC](https://discourse.nodered.org/t/filter-msg-payload-array-and-show-only-new-object/71641 "2022-12-03T11:12:18Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![MrThiemann](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrthiemann/32/68063_2.png) [@MrThiemann](https://discourse.nodered.org/u/MrThiemann)\
**Post date:** [15 December 2022 19:59 UTC](https://discourse.nodered.org/t/filter-msg-payload-array-and-show-only-new-object/71641/21 "2022-12-15T19:59:55Z")

</div>

which got me a little further... I added "updatet" to the index.js...  
then I can at least "sort" the list according to the appropriate order and can also identify the "new" devices.

```auto
                text: 'Updated',
                align: 'start',
                sortable: true,
                value: 'updated',
            },

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [15 December 2022 20:57 UTC](https://discourse.nodered.org/t/filter-msg-payload-array-and-show-only-new-object/71641/22 "2022-12-15T20:57:09Z")

</div>

> [@MrThiemann](#):
>
> i just sometimes have the feeling that devices that were already in the network are displayed as new devices... but somehow not always. so it's hard to reproduce.

That could be true in the XML file I think due to the way that nmap works. However, that's why you accumulate the data in node-red. I take in each run's xml, convert to json, add to/update the existing data in node-red and write out a json file to make sure I've got a copy.

> [@MrThiemann](#):
>
> I have an inject for this. because i don't really need a permanent cron job here.  
> or what are the advantages for you?

I wanted the script to run stand-alone even if node-red isn't running. Not really an advantage over driving it from node-red to be honest - more that I already had some other scripts that I run via CRON so that was what I thought of first.

> [@MrThiemann](#):
>
> My main concern is that when a new device is added to the network... WLED, ESP (or whatever) that I don't always have to look for it on the router first.

Good point. I don't have enough devices to make that automation necessary. I just want to be able to keep track of what is on the network. I use the web page to add descriptions as needed. I tend to give things a fixed IP in the router's DHCP settings. However, I recently had a router issue and it made me realise that having DHCP issued IP addresses - even fixed ones - is not a good idea if you want your local network devices to carry on working if the router is dead! Should have known better but it has been a very long time since I had a router failure (it was just the power supply that failed in fact).

---

<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:** [13 February 2023 20:57 UTC](https://discourse.nodered.org/t/filter-msg-payload-array-and-show-only-new-object/71641/23 "2023-02-13T20:57:34Z")

</div>

Closed on 13 February 2023 20:57 UTC

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

[Previous page](https://discourse.nodered.org/t/filter-msg-payload-array-and-show-only-new-object/71641.md?page=1)
