From: Ardis Lu Date: Sat, 25 Dec 2021 07:29:01 +0000 (-0800) Subject: Correct replace to replaceAll X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=4e8a351526f65f9ec0b90af3ea9a363251170093;p=sheets-db Correct replace to replaceAll replace will only replace the first value. --- diff --git a/Code.gs b/Code.gs index 22e5706..14dbbf8 100644 --- a/Code.gs +++ b/Code.gs @@ -77,7 +77,7 @@ function generateDatabaseQuery() { values += `'${data.toISOString()}',`; } else { - values += `'${data.replace(/'/g, "''")}',`; // Escape apostrophe with double apostrophe + values += `'${data.replaceAll(/'/g, "''")}',`; // Escape apostrophe with double apostrophe } break; case 'NULL':