I, through one service, write data to a table in the form of for example:

  • Date Name Email Status
  • 2016 Eugen test@test.com NEW

Then, through the API, I pull the table in the form of JSON and check with the cycle, if the status is NEW, then send a message to the mail.

At the moment it is necessary, after sending the letter, to change the status from NEW, for example to PENDING

Tell me how this can be done through the Google App Script macro
Thank you in advance

    1 answer 1

    Solution found.

    function doGet(event) { var email = event.parameter.email; var ss = SpreadsheetApp.openById("SPREATSHEET ID"); //SPREADSHEET ID заменить на Ваш id таблицы var sheet = ss.getSheetByName("Sheet1"); var dataRange = sheet.getDataRange(); var grid = dataRange.getValues(); grid.forEach(function (row, index) { if (row[2] == email) { var row = "D" + (index + 1); sheet.getRange(row).setValue('inPROGRESS'); } }); } 

    The API expects to receive the email variable.