最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

google apps script - Adapt ForEach function - Stack Overflow

programmeradmin3浏览0评论

I need to adapt the function below in order to get it working only in a 2d range A2:H10

Any help?

function processDocuments() {
  

  const ss = SpreadsheetApp.getActiveSpreadsheet();
  const customersSheet = ss.getSheetByName(CUSTOMERS_SHEET_NAME);
  const productsSheet = ss.getSheetByName(PRODUCTS_SHEET_NAME);
  const transactionsSheet = ss.getSheetByName(TRANSACTIONS_SHEET_NAME);
  const invoicesSheet = ss.getSheetByName(INVOICES_SHEET_NAME);
  const invoiceTemplateSheet = ss.getSheetByName(INVOICE_TEMPLATE_SHEET_NAME);

  
  const products = dataRangeToObject(productsSheet);
  const transactions = dataRangeToObject(transactionsSheet);
 const invoices = [];

  transactions.forEach(function (customer) {
 
    let invoice = createInvoiceForCustomer(
      customer, products, transactions, invoiceTemplateSheet, ss.getId());
    invoices.push(invoice);
  });
  

}
发布评论

评论列表(0)

  1. 暂无评论