Добавьте закладку в Google Chrome с помощью Google App Script - PullRequest
0 голосов
/ 05 августа 2020

Вопрос для всех мастеров:

Можно ли добавить URL-адрес электронной таблицы в Chrome закладки с помощью скрипта приложения?

Ситуация:

У меня лист, содержащий личные данные (адрес электронной почты) клиентов.

Требования GDPR, которые удаляются через 14 дней.

Итак, у меня есть сценарий, который очищает содержимое этого столбца.

Теперь, чтобы полностью удалить информацию и очистить ее из истории версий листа, если предполагается, просто сделайте копию листа и удалите старую версию, и все это в сценарии.

Проблема в том, что жизнь станет намного проще, если я смогу обновить закладку в Chrome на URL-адрес новой электронной таблицы, используя GAS.

Ура!

- --- КОД НИЖЕ ------

function deleteIDData() {


//loop through the names of the sheets and delete contents of cells in column F after 14 days


 var ss = SpreadsheetApp.getActive();
 var allsheets = ss.getSheets();
 
 //calculate date today -14 days and format to match the format of the name of the tab
 var date = new Date();
 var MILLIS_PER_DAY = 1000 * 60 * 60 * 24;
 var from = new Date(date - 14 * MILLIS_PER_DAY);
 var date1 = Utilities.formatDate(from, 'GMT+1', 'dd-MM')
 

  for(var s in allsheets){
    var sheet = allsheets[s];
       
    // Stop iteration execution if the condition is met.
    if(
       (sheet.getName() == "Config") || 
       (sheet.getName() == "Template") || 
       (sheet.getName() == "Terug te betalen") || 
       (sheet.getName() == "Overzicht") 
      ) continue;

     
  if (sheet.getName() == date1)   //check if the name of the tab is equal to date today -14 days
     
     {
     
     //execute this code if condition is met.
     
     sheet.getRange("F:F").clearContent();   //clear the emailadresses in column F
     
     }
  } // end of loop


/*
TO DO
- var newSS = ss.creatcopy(infolder) //reminder to me
- Delete ss //reminder to me

?? Is this possible ? set url of newSS in chrome bookmarks
*/
  
}

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...