I have been trying to get a form to output a guest list with up to 32 guest in a way that gives each guest on different rows of gsheets with their data broken down by column. I have an issue where my jotform data comes through to gsheets all in one cell, separated by line for each guest rather than placing each guest on a separate row. I need Full Name, First Name, Last Name, Email on each row. This is how the data looks that goes into the input for the code step on zapier : See Screen Grab for Input Result for Code Step
First Name: Dave, Last Name: Rush, Full Name: Dave Rush, Email: drush@rush.com
First Name: Meg, Last Name: Rush, Full Name: Meg Rush, Email: meg@rush.com
I believe the code (below) will work for my needs, but am stumped on how to do so, as I am a novice at JavaScript. Can anyone lend a hand to a total newb?? Thank you in advance!
let RE = new RegExp(/\[\"(\w{2,3})\"\]/, 'g'),
COMPLETED_STR = inputData.COMPLETED.toString(),
COMPLETED,
KEYS = ["A", "B"],
RESULT = {};
let i = 0;
while ((COMPLETED = RE.exec(COMPLETED_STR)) !== null) {
RESULT[KEYS[i++]] = COMPLETED[1];
}
output = RESULT;