Employee Database Prompt
Employee Database Prompt
2. 🧱 Spreadsheet Structure
Sheet Name: 'employee' – This spreadsheet contains 3 tabs:
A ID Auto-generated ID Unique
(5-char)
B Name Text
G Phone Text
Search Section
Buttons
Update Button
- Search by ID
- Load data into form
- On submission: update fields and replace attachments
- Update timestamp
View Button
📂 Additional Notes
- All dropdown/multiselect values come from `dv` tab:
- dv!A:A → Designation
- dv!B:B → Department
- dv!C:C → Blood Group / Career Progression
- dv!D:D → Status
- Google Maps smart address enabled via @ mention
- User email fetched from Session.getActiveUser().getEmail()
🎯 TASK FOR AI
You are a professional Google Apps Script and HTML developer.
▶️Please write:
- Full Google Apps Script code for data handling, file upload, and automation
- A modern, full-width HTML + CSS + JS form with dropdowns, file preview, and script
integration
1. Objective
I am preparing a employee google spreadsheet, where I will basically creating a database,
and i will enter the data by the HTML forms inside google spreadsheet by script.
2. Data structure
-"form"
-"db"
-"dv"
(ii) On the "db" tab, I'll stored all the data, and has the column name:
Column E - "Present address" - Address integrate with google map like in the
spreadsheet if i type @ and then i can search location and can entry
Column F - "Permanent address" - Address integrate with google map like in the
spreadsheet if i type @ and then i can search location and can entry
Column K - "Blood group" - this will be an option (dropdown) and the dropdown
options are stored in the same spreadsheet file but in a different worksheet called "dv" and
the column name is "Blood group" in column C
Column N - "Career progression" - this field will have multiple option selection options
and the dropdown options are stored in the same spreadsheet file but in a different
worksheet called "dv" and the column name is "Designation" in column C
Column P - "Appointment letter" - file attachment but the data will be saved in the sheet as
link named as "view"
Column Q - "Employment contract" - file attachment but the data will be saved in the sheet
as link named as "view"
Column R - "CV" - file attachment but the data will be saved in the sheet as link named as
"view"
Column S - "NID_Passport" - file attachment but the data will be saved in the sheet as link
named as "view"
Column T - "ID card" - file attachment but the data will be saved in the sheet as link named
as "view"
Column U - "Salary statement" - file attachment but the data will be saved in the sheet as
link named as "view"
Column V - "TIN certificate" - file attachment but the data will be saved in the sheet as link
named as "view"
Column Y - "timestamp" - whenever user will add the data or update the data it will add the
date and time in this field.
Column Z - "user" - user is the current user who are logged in and who entry the data, his
email name or user will be automatically recorded there.
4. Form
The form will have all label and input mentioned in the data detailed data structure except
"ID","timestamp", and "user" as it will be generated automatically by the script.
There will be a search option in the top, where the user can search employee by their ID a
search icon behaving as a button will be there with the input field and the placeholder will
be "Search"
Then after the label and input field, there will be multiple button
"Add"
"Update"
"View"
Form has to be modernly designed (with CSS, JS if required) with the full width of the form.
and wherever we have dropdown options/multiple selection option in the input field, you
add a search option there so user can easily search and add it.
4. Function
"Add" button will trigger the function where the form will be saved in the sheet called "db"
and make sure after clicking the add button, you must have have to do this thing:
{In this case i want my file attachment data should be stored in a google drive folder
called "employee_attachment" and the drive folder id is
"1eop0aevORfmCTpUblG9pa6Rq9TfYUlcY"
In here whenever a new employee will be created a new folder will be created by
the "Name" of the employee from the entry and all the attachment will be stored in that
specific folder. and the naming convention of the file inside the folder will be by the label
"Name" + attachment label.}
"Update" this function will interact with the search input field on the form, first the user will
search employee by their "ID" after clicking or enter the search icon, it'll retrieve the data
from the datasheet "db" and will show on the relevant input field on the form and there user
can edit the input field and after updating the field, when user will create the button
"Update" it'll update and save in the relevant row on the sheet "db". and if it is a file
attachment, make sure you remove the specific file and save the new one.
"View" this function will behave like as a pdf report where this will show all the value of the
current input field with label and attachment file will have the link e.g. "View CV" and will
open in a new blank tab