Filter Data from array & Associate them

What are you trying to achieve?

Hello Team,
I hope you are well.

I have an issue with an automation. I want to filter the data retrieved from the “HTTP” module and then associate two data points (URL and the corresponding city) for later use.

Steps taken so far

From the HTTP module, I parse the JSON to get structured data. Then, I set the variables I’m interested in: “City” and “URL”. After that, I use an iterator and an aggregator, followed by a filter on the desired city before sending the data to a Google Sheet.

I am able to get only the desired city. However, the URL is incorrect.

For example, if the data looks like this:

London | URL 1
London | URL 2
Leeds | URL 3

At the end, if I want to get “Leeds” in the sheet, I would get Leeds | URL 1.

So, I am getting the URL in the order of the data’s appearance, not connected to the city filter at all.

Screenshots: scenario setup, module configuration, errors

blueprint (1).json (33.9 KB)

Hi @hugo2
You can apply filter like this:

Regards,
Msquare Automation - Gold Partner of Make

Free Consultation | Live Implementation

Visit us here | Youtube Channel

Hello @Msquare_Automation and ty for your reply.

I’m not sure I fully understand.

In the HTTP module, I receive events that include “City” and “URL”. In each call to the module, I receive about 500 events, each with a city name and a URL.

I want to filter these events to only get those from a specific city like “London” and retrieve the associated URL for each London event, which are different.

It seems that in your example, I need to know the URL to filter

2 Likes

For exemple, an event is like that for french example in parse json

Hey @hugo2

Sorry for the confusion. You need to use get and map function for this.

get(map(YOUR_ARRAY;URL;CITY;LONDON);1)

This works like you want url where city is london.

Regards,
Msquare Automation - Gold Partner of Make

Free Consultation | Live Implementation

Visit us here | Youtube Channel

2 Likes

Hey,

Oups like that

You are missing a semicolon ; before the 1

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

1 Like

Ty ! But doesn’t change anything.

Oh, looks like the condition needs to be simply this, since you are using an array operator in the filter.

map(ARRAY; city)

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

Okay, 1 is just for the first item in array right ? But when I pull the request, I have between 50 to 100 events directly in array