onInstall()
Triggers when the add-on is installed, calling onOpen()
to initialize the custom menu.
onOpen(e)
Creates a custom menu named "DataMate 🌐" in Google Sheets with options for saving records, resetting inputs, managing templates, building forms, handling contacts, and showing tutorials.
doNothing()
Displays an alert prompting the user to select a template option when no specific action is chosen.
showUploadDialog()
Opens a modal dialog to upload a CSV file, using the UploadCSV.html
interface for importing contacts.
processCSV(csvContent)
Parses and processes uploaded CSV data, mapping specific columns from an "Import" sheet to a "contacts" sheet based on predefined mappings, then notifies the user of successful import.
edit()
Populates the "Address" sheet with VLOOKUP formulas to retrieve contact details (e.g., company, email, address) from the "contacts" sheet based on a lookup value in cell F1.
newcontact()
Adds a new contact by copying data from the "NewContact" sheet to the "contacts" sheet, inserting a new row, setting a concatenated name formula, sorting contacts, and clearing input fields.
copyInput1()
Copies data, formats, formulas, and column widths from "Sheet1" (A3:Q48) to the "Input" sheet, then activates cell C4 in the "Input" sheet.
copyInput2()
Copies data, formats, formulas, and column widths from "Sheet1" (A3:Q48) to the "View_Print" sheet, then activates cell A1 in the "View_Print" sheet.
newfile()
Creates or verifies the existence of core sheets ("Input", "View_Print", "Log", "Update", "Data"), sets up headers, formulas, formatting, and a help hyperlink, then calls copyInput1()
, view()
, and sends a notification email.
sendDataMateEmail()
Sends an email to "projectprodigyapp@gmail.com" with the subject "DataMate Dataset Created" to notify that a new dataset has been added.
save()
Saves data from the "Input" sheet (A1:Q48) to the "Data" sheet in specific columns, copies images, updates the "Update" and "Log" sheets with formulas, adds a hyperlink to "View_Print", and sends a notification email.
sendDataMateEmail1()
Sends an email to "projectprodigyapp@gmail.com" with the subject "DataMate Record" to notify that a new record has been saved.
view()
Refreshes the "View_Print" sheet by calling copyInput2()
and setting VLOOKUP formulas to display data from the "Update" and "Data" sheets based on a key in A1.
contacts()
Creates or updates "contacts", "Address", and "NewContact" sheets, sets up headers, formulas, data validation, and formatting for contact management, then activates cell B1 in the "Address" sheet.
EditAddressSheet()
Applies VLOOKUP formulas to the "Address" sheet (F2:F14) to fetch contact details by name from the "contacts" sheet, adds data validation to a specified cell in "Sheet1", and copies formulas below it.
EditAddressSheet1()
Applies INDEX/MATCH formulas to the "Address" sheet (G2:G14) to fetch contact details by company from the "contacts" sheet, adds data validation to a specified cell in "Sheet1", and copies formulas below it.
setup()
Initializes an "Inventory" template by creating or configuring sheets (e.g., "Inventory", "Stock") with predefined headers, formulas, and formatting for tracking inventory items.
updateInventory()
Updates the "Inventory" sheet by copying new or modified stock data from an input range to a master inventory log, recalculating totals, and maintaining stock levels.
setupTS()
Sets up a "Weekly Timesheets" template by creating sheets (e.g., "Timesheet", "Summary") with headers, time-tracking formulas, and data validation for employee hours.
copyToCodeTotals()
Copies cost code data from a timesheet or input sheet to a "Code Totals" sheet, aggregating hours or costs by code for financial tracking.
setupPO()
Configures a "Purchase Order" template by creating sheets (e.g., "PO", "Items") with headers, formulas for totals, and data validation for supplier and item details.
previewForm()
Displays a preview of a form built in the "FormSetup" sheet, rendering fields defined in the FormBuilder (e.g., Text, Dropdown) using an HTML interface for testing.
showFormBuilder()
Opens a sidebar or modal dialog with the FormBuilder.html
interface, allowing users to create or edit form fields and save configurations to the "FormSetup" sheet.
showMailItSidebar()
Displays a sidebar using MailIt.html
to compose emails, selecting sheets, ranges, and contacts for sending or drafting emails with embedded data.
showTutorial()
Opens a modal dialog or sidebar displaying a tutorial with instructions on using DataMate’s features, such as templates, forms, and contact management.