Convert Array to String for URL/Input parameter passing to Slate

I have a selector that I want to pass the selections to an embedded Slate page from Workshop. It works fine when I have it set to Single selection and the return is a string already. When I set it to Multiple, it returns an array of strings. I was trying to transform it into a concatenated string, but can’t seem to find documentation or a method. It’s possible this is not supported, but I thought I would ask.

What is your comfort level with TypeScript functions? I think this can be solved using a TypeScript function that takes a String array as an input and outputs a concatenated string. I asked chatGPT, and it gave the function below, but I haven’t tested it.

// Convert a list to a concatenated string
@Function()
public listToStr(list: string[]): string {
    return list.join(", ");
}
1 Like