Skip to content

Instantly share code, notes, and snippets.

@HubSpotHanevold
Created November 28, 2022 18:02
Show Gist options
  • Save HubSpotHanevold/d97e8e204de53ce064c38e7205d16cf4 to your computer and use it in GitHub Desktop.
Save HubSpotHanevold/d97e8e204de53ce064c38e7205d16cf4 to your computer and use it in GitHub Desktop.
let Existing = inputData.existing_values;
let Existing_Labels = inputData.existing_labels;
let Looped_Output = "";
Existing = Existing.split(",");
Existing_Labels = Existing_Labels.split(",");
for (let i = 0; i < Existing.length; i++) {
Looped_Output += '{\n "label": "' + Existing_Labels[i] +'", \n"value": "' + Existing[i] + '"\n},\n';
}
output = [{Looped_Output, Existing}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment