メインコンテンツにスキップ

Expense_Report_Form

Google Apps Script による経費精算申請フォーム

AI Summary

Expense_Report_Form

A GAS library that builds an expense-report Google Form linked to a Spreadsheet in just a few lines of code.

Target Users

GAS-intermediate developers who need an in-house expense-reporting workflow.

Problems Solved

Manually creating and linking an expense-report Form with a response Spreadsheet is tedious and error-prone.

Tags

Main Features

1
Automatic Form–Spreadsheet linkage

Calling setTitle, setSpreadSheetUrl and syncData auto-generates the Form and binds it to the response sheet.

2
API-based destination & category setup

addApplyTo and addCategory let you register destinations and expense categories programmatically, eliminating manual UI steps.

3
Data submission via WebApp/API

Using excute() and addData(), records can be added either through the published WebApp or programmatically.

Usage Examples

Generate and sync an expense-report Form

function setupExpenseForm() {
  // Set form title and target spreadsheet
  ExpenseReportForm.setTitle('Expense Report Form');
  ExpenseReportForm.setSpreadSheetUrl('https://docs.google.com/spreadsheets/d/XXXXXXXXXXXXXXXXXX/edit');

  // Define destination and category
  ExpenseReportForm.addApplyTo('Operations');
  ExpenseReportForm.addCategory('Operations', 'Meeting');

  // Create the Form and link it to the sheet
  ExpenseReportForm.syncData();
}

Running the function creates a Google Form linked to the given Spreadsheet and adds "Operations > Meeting" as a selectable category.