Array of Collections into CustomJS Module

When asking your question, please include:

:footprints: The steps you have taken

I currently have a scenario that extracts a list of items from a Webflow collection. Some of the fields in this collection are arrays.

After listing the items and feeding into an aggregator, this spits out an array of collections. Each collection corresponds to one of the items in the webflow collection.

I now want to take this list of items, and feed it into a customjs module, to process this list (basically go through a series of steps to decide on a subset of the items and spit out that list to then do stuff with). The problem I have is getting this array of collections into a format that the customjs module can interpret.

I first tried just entering the Array from the aggregator module into the input section of the customjs module then returning the input to see what it did. I just got [Collection],[Collection]…etc

I then ended up trying to map each of the fields to their own arrays, which worked (though this is messy), but this didn’t work wit the fields that are arrays, and just flattenened them, making it impossible to separate out, as some arrays different lengths.

Please help!
:camera_flash: Relevant screenshots
:link: Any links you have
[ Code { "and": "JSON", "in" : "code block"} ]
:x: Exclude Personal Information.

Try, Transform to JSON module.

1 Like