Combining Google Apps Script with Google AppSheet

Sample Google Sheet

  1. Name of the Product
  2. Category of the Product
  3. Image of the Product
  4. Initial stock of the Product
  5. Restock Level of the Product

Step1: Google Apps Script Automation script

  1. Click on extensions and open the Script Editor
function main(Product,Category,InitialStock) {    const sheet_ID = "1rLgHO-ECR8_mxJTnGjSM5hBOT1PgPY86EeHS6Ypb_Xs"    const ss = SpreadsheetApp.openById(sheet_ID)    const sheet = ss.getSheetByName("Inventory")
  1. Name of the Product
  2. Category of the Product
  3. Initial stock of the Product
const sheet_ID = "1rLgHO-ECR8_mxJTnGjSM5hBOT1PgPY86EeHS6Ypb_Xs"const ss = SpreadsheetApp.openById(sheet_ID)const sheet = ss.getSheetByName("Inventory")
const body = "Details of new product added" +  "<br><br>" +"Product Name        : " + Product +  "<br><br>" +"Category of Product : " + Category +  "<br><br>" +"Initial Stock       : " + InitialStock +  "<br><br>";
const target_email = Session.getActiveUser().getEmail()
const email_Subject = "New product added to Inventory";MailApp.sendEmail(target_email,email_Subject,"",{htmlBody: body})}
  1. Target Email
  2. Subject of the Email
  3. Body of the Email

Step2: Add AppScript inside AppSheet

  1. Go to the Automation Tab in Google AppSheet

Step3: Check the Output

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store