Json array filtering

Is there a way to filter a Json array that contains the scanned wifi networks on an area based on their ssid? Because right now every network in the area displays on the ui. I only need the networks with the specific characters.

For example, the area contains 10 networks and i only need the networks with ssids containing "ESP_***" the *** can be any 3-digit combination.

this is what my flow looks like.

Use a debug to show the structure of the data you want to filter and post it here so we can see exactly what you have. Note that a JSON object is, by definition, a string. Perhaps you mean a javascript object containing an array. Also tell us exactly what you want to see in the filtered output.

image

I only want to show the network with the ssid that has "ESP_***" with it.

edit:

image
this is how it looks like on the ui

With function node probably like this

msg.payload = msg.payload.Networks.filter(el => el.SSID.includes("ESP_"))
return msg
2 Likes

It works when I connect it to a debug node. But I need it to display on the ui, what do I need to change in this template node?

image

change the ng-repeat to "x in msg.payload"

It is now working. Thank you!

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