Skip to main content

Join Array Items with Delimiter using JavaScript Code

  • March 2, 2022
  • 0 replies
  • 408 views
Join Array Items with Delimiter using JavaScript Code
Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14

📌  We do our best to ensure that the code in these articles works as advertised, but please be aware that Zapier Support does not officially help with code steps due to their advanced nature. Feel free to comment on the article or ask in the Zapier Community, where we have code-savvy users.

The Purpose

To create a concatenated text string with a custom delimiter from an array of line items.

How to Configure

Copy the Code

let Set = inputData.Set;
Set = Set.split(","); // splits by commas to create create an array of line items
Set = Set.join(" & "); // joins all of the array line items by &

/*
// can be simplified into 1 line
let Set = inputData.Set.split(",").join(" & ");
*/

output = [{Set}];

The Results

Contribution by Troy Tessalone

Troy is a Certified Zapier Expert who automates workflows with no-code and low-code apps to help clients save time and make money.

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.