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 grammatical 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
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)
);
google-apps-script google-sheets appscript
add a comment |
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)
);
google-apps-script google-sheets appscript
Review how triggers work. developers.google.com/apps-script/guides/triggers/…
– tehhowch
Mar 8 at 13:05
add a comment |
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)
);
google-apps-script google-sheets appscript
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)
);
google-apps-script google-sheets appscript
google-apps-script google-sheets appscript
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
add a comment |
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Review how triggers work. developers.google.com/apps-script/guides/triggers/…
– tehhowch
Mar 8 at 13:05