I’m using a Run Code block to split a string into words, and the number of words may vary.
There is no output type of Array or Object.
The only way around that I found so far is to define a fixed number of output elements, and default them to “”.
Is there a better way?
Thanks
let wordsArray = input.metaobject.text.split(' ');
return {
word_1 : wordsArray[0] ?? "",
word_2 : wordsArray[1] ?? "",
word_3 : wordsArray[2] ?? "",
word_4 : wordsArray[3] ?? "",
}