1
votes

enter image description here

I want to find the particular values in a google sheet, once its found then fetch total row values and send email from google sheet with the total row values.

I'm aware of send email from google-sheet but finding the particular value based on that send email is very challenging for me.

Wherever E60 is present the should fetch total row values and need to send email.

2
Can you provide your current script and the sample Spreadsheet including the input and output you expect? Of course, please remove your personal information.Tanaike

2 Answers

0
votes

To send a email via google sheet you will need to write some code with script editor. I think you could find more details here

0
votes

After studying your question, I assume the following:

  • You want to check a column matching the string E60.
  • When a cell with E60 is found, your want to send a email with the full row content.

If my assumptions are correct, you can use the following example to fulfill your requests:

CODE

function E60Alert() {
  var sheet = SpreadsheetApp.openById(
    '{SPREADSHEET ID}').getSheetByName('Sheet1');
  var lastRow = sheet.getLastRow();
  var lastColumn = sheet.getLastColumn();
  var subject = "E60 Alert";
  var email = "{YOUR EMAIL}";
  var rowContent = sheet.getRange(1, 1, lastRow, lastColumn).getValues();

  for (var i = 1; i <= lastRow; i++) {
    if (rowContent[i - 1][4] == 'E60') {
      MailApp.sendEmail(email, subject, rowContent[i - 1]);
    }
  }
}

BEHAVIOUR

That code will first read the full table. After that, it will iterate it searching for the desired string (E60 in this case). If it finds it, it will send an email with the full row content.

OBSERVATIONS

  • This code will run on demand by clicking the Run button.
  • You will have to edit the if (rowContent[i - 1][4] == 'E60') { line to match the desired column of the data. I chose the fifth column (number 4) for testing purposes.

ALLUSIONS

Please take this as one of the possible solutions to your issue, and don't hesitate to write me back with any additional doubts or requests to further clarifications.