Skip to content
// The Sheets step runs with "On Error: Continue"; saved only if the row came back with our email.
const lead = $('Combine').first().json;
const r = $input.first().json;
const saved = !r.error && r.email === lead.email;
return [{
  json: {
    ...lead,
    saved,
    save_error: saved ? null : (typeof r.error === 'string' ? r.error : r.error?.message) ?? 'no row returned (check the Google Sheets credential and sheet URL)',
  },
}];