Choose specific data of a row by its indexCopy data from one file to another for rows with a same index valueGoogle Script: InputBox with drop down list spreadsheet (Not FORM)Generate a Google Doc (and PDF) of row data when a cell in a row of a sheet is editedTrying to make a script that scans a Google Sheet and emails if values are below 60%Counting rows between two specific rowsUnstable Behavior for mailApp.sendEmailSend email when certain data is selected from drop downHow to insert data into a specific row number (or the first empty row)?Google Script gives unknown errorPushing Data to Matching Row in Index

What is this type of notehead called?

What linear sensor for a keyboard?

Greco-Roman egalitarianism

Did US corporations pay demonstrators in the German demonstrations against article 13?

Drawing ramified coverings with tikz

Can I use my Chinese passport to enter China after I acquired another citizenship?

When quoting, must I also copy hyphens used to divide words that continue on the next line?

Why in book's example is used 言葉(ことば) instead of 言語(げんご)?

If a character with the Alert feat rolls a crit fail on their Perception check, are they surprised?

Did arcade monitors have same pixel aspect ratio as TV sets?

Is possible to search in vim history?

What (else) happened July 1st 1858 in London?

Is it possible to have a strip of cold climate in the middle of a planet?

Has Darkwing Duck ever met Scrooge McDuck?

Confusion on Parallelogram

What is the gram­mat­i­cal term for “‑ed” words like these?

List of people who lose a child in תנ"ך

How do I repair my stair bannister?

Can I sign legal documents with a smiley face?

How do I extrude a face to a single vertex

A social experiment. What is the worst that can happen?

How can Trident be so inexpensive? Will it orbit Triton or just do a (slow) flyby?

Could the E-bike drivetrain wear down till needing replacement after 400 km?

My friend sent me a screenshot of a transaction hash, but when I search for it I find divergent data. What happened?



Choose specific data of a row by its index


Copy data from one file to another for rows with a same index valueGoogle Script: InputBox with drop down list spreadsheet (Not FORM)Generate a Google Doc (and PDF) of row data when a cell in a row of a sheet is editedTrying to make a script that scans a Google Sheet and emails if values are below 60%Counting rows between two specific rowsUnstable Behavior for mailApp.sendEmailSend email when certain data is selected from drop downHow to insert data into a specific row number (or the first empty row)?Google Script gives unknown errorPushing Data to Matching Row in Index













0















I am creating an approval workflow for my company using gg form and gg sheet. As the picture below, whenever an approver choose approve or reject in the H column, an email will automatically generate and use data in the sheet below then send to the security guy.



The problem i am facing is that for example the approver approve the request at row 4th, I do not know how to get the data at row 4th then create an email with 4th row data. I have used getRowIndex function but somehow fail. Here is my code:



var sheet = SpreadsheetApp.openById('1NoVx8cLL_x4QAJA_hNIP3bwdpwMyiSn6WZ4iGBb53Tg');
var ss = sheet.getSheetByName('Approval');
var data = ss.getDataRange().getValues();
var lastRow = ss.getLastRow();
var Status = ss.getRange(lastRow, 8).getValue();
var Index = ss.getRange(lastRow, 8).getRowIndex();

function OnEdit(e)
var data = Onsubmitssion();
if(Status == 'Approve')
SendApprovedEmail(data);
SendEmailSecurityInform(data);

if(Status == 'Reject')
SendRejectedEmail(data);


function Onsubmitssion(data)
this.SPName = ss.getRange(Index, 3).getValue();
this.Quantity = ss.getRange(Index, 4).getValue();
this.VendorName = ss.getRange(Index, 5).getValue();
var AttachmentID = ss.getRange(Index, 6).getValue();
this.res = AttachmentID.substring(33);
var res = AttachmentID.substring(33);
var files = DriveApp.getFileById(res);
DriveApp.getFolderById("1D274UGBirLMFdyafNAAN2_463m1990z2").addFile(files);
files.addViewer('tung_hoang@colpal.com');
return this;

function SendApprovedEmail(data)
var Requestor = ss.getRange(Index, 2).getValue();
MailApp.sendEmail(
to:Requestor,
subject: "Approval for spare part lending",
htmlBody: htmlEmailApproved(data)
);


function SendRejectedEmail(data)
var Requestor = ss.getRange(Index, 2).getValue();
MailApp.sendEmail(
to:Requestor,
subject: "Spare part lending rejected",
htmlBody: htmlEmailRejected(data)
);

function SendEmailSecurityInform(data)
MailApp.sendEmail(
to:'tung_hoang@colpal.com',
subject: "Yêu cầu mang hàng ra cổng",
htmlBody: htmlEmailSecurity(data)
);



enter image description here










share|improve this question






















  • Review how triggers work. developers.google.com/apps-script/guides/triggers/…

    – tehhowch
    Mar 8 at 13:05















0















I am creating an approval workflow for my company using gg form and gg sheet. As the picture below, whenever an approver choose approve or reject in the H column, an email will automatically generate and use data in the sheet below then send to the security guy.



The problem i am facing is that for example the approver approve the request at row 4th, I do not know how to get the data at row 4th then create an email with 4th row data. I have used getRowIndex function but somehow fail. Here is my code:



var sheet = SpreadsheetApp.openById('1NoVx8cLL_x4QAJA_hNIP3bwdpwMyiSn6WZ4iGBb53Tg');
var ss = sheet.getSheetByName('Approval');
var data = ss.getDataRange().getValues();
var lastRow = ss.getLastRow();
var Status = ss.getRange(lastRow, 8).getValue();
var Index = ss.getRange(lastRow, 8).getRowIndex();

function OnEdit(e)
var data = Onsubmitssion();
if(Status == 'Approve')
SendApprovedEmail(data);
SendEmailSecurityInform(data);

if(Status == 'Reject')
SendRejectedEmail(data);


function Onsubmitssion(data)
this.SPName = ss.getRange(Index, 3).getValue();
this.Quantity = ss.getRange(Index, 4).getValue();
this.VendorName = ss.getRange(Index, 5).getValue();
var AttachmentID = ss.getRange(Index, 6).getValue();
this.res = AttachmentID.substring(33);
var res = AttachmentID.substring(33);
var files = DriveApp.getFileById(res);
DriveApp.getFolderById("1D274UGBirLMFdyafNAAN2_463m1990z2").addFile(files);
files.addViewer('tung_hoang@colpal.com');
return this;

function SendApprovedEmail(data)
var Requestor = ss.getRange(Index, 2).getValue();
MailApp.sendEmail(
to:Requestor,
subject: "Approval for spare part lending",
htmlBody: htmlEmailApproved(data)
);


function SendRejectedEmail(data)
var Requestor = ss.getRange(Index, 2).getValue();
MailApp.sendEmail(
to:Requestor,
subject: "Spare part lending rejected",
htmlBody: htmlEmailRejected(data)
);

function SendEmailSecurityInform(data)
MailApp.sendEmail(
to:'tung_hoang@colpal.com',
subject: "Yêu cầu mang hàng ra cổng",
htmlBody: htmlEmailSecurity(data)
);



enter image description here










share|improve this question






















  • Review how triggers work. developers.google.com/apps-script/guides/triggers/…

    – tehhowch
    Mar 8 at 13:05













0












0








0








I am creating an approval workflow for my company using gg form and gg sheet. As the picture below, whenever an approver choose approve or reject in the H column, an email will automatically generate and use data in the sheet below then send to the security guy.



The problem i am facing is that for example the approver approve the request at row 4th, I do not know how to get the data at row 4th then create an email with 4th row data. I have used getRowIndex function but somehow fail. Here is my code:



var sheet = SpreadsheetApp.openById('1NoVx8cLL_x4QAJA_hNIP3bwdpwMyiSn6WZ4iGBb53Tg');
var ss = sheet.getSheetByName('Approval');
var data = ss.getDataRange().getValues();
var lastRow = ss.getLastRow();
var Status = ss.getRange(lastRow, 8).getValue();
var Index = ss.getRange(lastRow, 8).getRowIndex();

function OnEdit(e)
var data = Onsubmitssion();
if(Status == 'Approve')
SendApprovedEmail(data);
SendEmailSecurityInform(data);

if(Status == 'Reject')
SendRejectedEmail(data);


function Onsubmitssion(data)
this.SPName = ss.getRange(Index, 3).getValue();
this.Quantity = ss.getRange(Index, 4).getValue();
this.VendorName = ss.getRange(Index, 5).getValue();
var AttachmentID = ss.getRange(Index, 6).getValue();
this.res = AttachmentID.substring(33);
var res = AttachmentID.substring(33);
var files = DriveApp.getFileById(res);
DriveApp.getFolderById("1D274UGBirLMFdyafNAAN2_463m1990z2").addFile(files);
files.addViewer('tung_hoang@colpal.com');
return this;

function SendApprovedEmail(data)
var Requestor = ss.getRange(Index, 2).getValue();
MailApp.sendEmail(
to:Requestor,
subject: "Approval for spare part lending",
htmlBody: htmlEmailApproved(data)
);


function SendRejectedEmail(data)
var Requestor = ss.getRange(Index, 2).getValue();
MailApp.sendEmail(
to:Requestor,
subject: "Spare part lending rejected",
htmlBody: htmlEmailRejected(data)
);

function SendEmailSecurityInform(data)
MailApp.sendEmail(
to:'tung_hoang@colpal.com',
subject: "Yêu cầu mang hàng ra cổng",
htmlBody: htmlEmailSecurity(data)
);



enter image description here










share|improve this question














I am creating an approval workflow for my company using gg form and gg sheet. As the picture below, whenever an approver choose approve or reject in the H column, an email will automatically generate and use data in the sheet below then send to the security guy.



The problem i am facing is that for example the approver approve the request at row 4th, I do not know how to get the data at row 4th then create an email with 4th row data. I have used getRowIndex function but somehow fail. Here is my code:



var sheet = SpreadsheetApp.openById('1NoVx8cLL_x4QAJA_hNIP3bwdpwMyiSn6WZ4iGBb53Tg');
var ss = sheet.getSheetByName('Approval');
var data = ss.getDataRange().getValues();
var lastRow = ss.getLastRow();
var Status = ss.getRange(lastRow, 8).getValue();
var Index = ss.getRange(lastRow, 8).getRowIndex();

function OnEdit(e)
var data = Onsubmitssion();
if(Status == 'Approve')
SendApprovedEmail(data);
SendEmailSecurityInform(data);

if(Status == 'Reject')
SendRejectedEmail(data);


function Onsubmitssion(data)
this.SPName = ss.getRange(Index, 3).getValue();
this.Quantity = ss.getRange(Index, 4).getValue();
this.VendorName = ss.getRange(Index, 5).getValue();
var AttachmentID = ss.getRange(Index, 6).getValue();
this.res = AttachmentID.substring(33);
var res = AttachmentID.substring(33);
var files = DriveApp.getFileById(res);
DriveApp.getFolderById("1D274UGBirLMFdyafNAAN2_463m1990z2").addFile(files);
files.addViewer('tung_hoang@colpal.com');
return this;

function SendApprovedEmail(data)
var Requestor = ss.getRange(Index, 2).getValue();
MailApp.sendEmail(
to:Requestor,
subject: "Approval for spare part lending",
htmlBody: htmlEmailApproved(data)
);


function SendRejectedEmail(data)
var Requestor = ss.getRange(Index, 2).getValue();
MailApp.sendEmail(
to:Requestor,
subject: "Spare part lending rejected",
htmlBody: htmlEmailRejected(data)
);

function SendEmailSecurityInform(data)
MailApp.sendEmail(
to:'tung_hoang@colpal.com',
subject: "Yêu cầu mang hàng ra cổng",
htmlBody: htmlEmailSecurity(data)
);



enter image description here







google-apps-script google-sheets appscript






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 8 at 7:10









Huỳnh TùngHuỳnh Tùng

3217




3217












  • Review how triggers work. developers.google.com/apps-script/guides/triggers/…

    – tehhowch
    Mar 8 at 13:05

















  • Review how triggers work. developers.google.com/apps-script/guides/triggers/…

    – tehhowch
    Mar 8 at 13:05
















Review how triggers work. developers.google.com/apps-script/guides/triggers/…

– tehhowch
Mar 8 at 13:05





Review how triggers work. developers.google.com/apps-script/guides/triggers/…

– tehhowch
Mar 8 at 13:05












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55058375%2fchoose-specific-data-of-a-row-by-its-index%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55058375%2fchoose-specific-data-of-a-row-by-its-index%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived