How to get to only the first bundle in an array

I am pulling profile data from LinkedIn but only want to grab the persons current job details and not their past roles where they are no longer involved.

The HTTP request pulls an array of job roles for a profile.

I am trying to filter to just the first/latest role. Wtihout an iterator, the output in the HTTP request just displays the oldest/first job role which I’m not interested in.

I have added an Iterator which bundles all the jobs nicely. However I am not interested in Bundle 2 onwards. The only filterable difference between bundles is the end year, month, day of the role. e.g. their current and active job will have “0” in the year, month and day fields. All the past roles will have the year, month, day.

I have tried setting a filter inbetween the HTTP and the Iterator but its just ignored. I’ve tried where year does not exist (it has a 0 in the field), I’ve tried where year field length is greater than 1.

Any insights?

You don’t need an iterator if you only want the first item in an array.

You can use the built-in function first

e.g.:

first(1.array)

For more information, see the function documentation in the Help Center.

samliewrequest private consultation

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

1 Like

Thanks @samliew
Where would I use that if I dont have an iterator? Currently I have two modules.

HTTP request
CRM module

the request returns the last item in the array if I run only that module
so not sure how to map each returned field to the crm

I presume I need something inbetween these modules to putput the json so that I can map each field properly.

You can use a basic Set Variable module.

Got It! Thank you very much