Describe the issue/error/question
Hi all, I have an array of comma-separated values and I’m trying to convert them to hashtags. Essentially I’m trying to add the # symbol before each and remove the spaces. Any idea if there is an easy way to accomplish this? The values come in like: “value one, value two” and I’m trying to transform them with a function to “#valueone, #valuetwo”. I tried this to at least get the hashtags but I keep getting an error:
const tags = '{{$json["categories"].toString()}}';
const result = `#${tags.replace(/,/g, '#')}`;
return result;
What is the error message (if any)?
ERROR: Always an Array of items has to be returned! [Line 100]
Information on your n8n setup
- n8n version: Latest
- Database you’re using (default: SQLite): SQLite
- Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker