Collect and format emails from JSON returned by Google Sheets
const regex = /\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,24})+/gm ;
const input = 'MAP_PABBLY_OUTPUT_FROM_PREVIOUS_STEP_HERE' ;
let results = input.match(regex) ;
let list = [] ;
for (let result of results){
list.push(`{"emailAddress" : {"address" : "${result}"}}`) ;
}
return list.join(', ') ;
Comments