I need some help figuring out how to use functions to measure the length of each word in an array

A beginner here!


I’m trying to split a sentence “Make.com simplifies automation for everyone” word by word. Then measure the length of each word.

I’ve managed to split the words into a single word array with split( function but I don’t understand how I can map it so it measures the length( of each word individually. No matter what I do it ends up measuring the amount of collections in the array.

If someone could help me figuring this out and also explain the logic behind the solution.

Thank you!

So you should split by space rather than / since the original string doesn’t contain /.

Then you can iterate your new array and derive the length of each word, and then aggregate back into a new array, with the word and its length:

Here’s a blueprint
blueprint (24).json (5.9 KB)

So cool! I think I was too focused on making this work in a single module with just functions in the “set variable” module, that I didn’t consider this. When I asked chatGPT, it told me to map each of the lines etc. Thank you for this! If anyone knows a way to do this with less modules, I’d be very curious to hear about it. Thanks