From 110769853138083f6cbdbcfa39af564718061af1 Mon Sep 17 00:00:00 2001 From: jayantfriend Date: Thu, 6 Jul 2023 13:30:25 +0530 Subject: [PATCH] Create updateDetails for review cell details --- functions/updateDetails | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 functions/updateDetails diff --git a/functions/updateDetails b/functions/updateDetails new file mode 100644 index 0000000..0e7e9f6 --- /dev/null +++ b/functions/updateDetails @@ -0,0 +1,16 @@ +function updateDetails(e) { + // Prevent errors if no object is passed. + if (!e) return; + // Get the active sheet. + e.source.getActiveSheet() + // Set the cell you want to update with the date. + .getRange('M2') + // Update the date. + .setValue(new Date()); + // Get the active sheet. + e.source.getActiveSheet() + // Set the cell you want to update with the user. + .getRange('M3') + // Update the user (only email is available, and only if security settings allow). + .setValue(e.user.getEmail() ); +}