google-no-code – skill Lập trình cho agent AI
Thiết kế Google Forms và kết nối trigger Apps Script (onFormSubmit) để gửi cảnh báo email, ghi log vào spreadsheet và tạo câu hỏi động — không cần trình soạn code.
Cài skill google-no-code bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/google-no-code-05388.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /google-no-code – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/google-no-code-05388.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $google-no-code – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/google-no-code-05388.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /google-no-code – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/google-no-code-05388.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /google-no-code – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Google No-Code Forms Automation
Overview
Guides the user through building a Google Form in the Forms UI and connecting it to Google Apps Script triggers, without writing a custom integration or leaving the browser. Covers form design, the Apps Script editor, the onFormSubmit trigger, and small response-handling scripts that run automatically when a form is submitted.
When to Use This Skill
- Use when the user wants to build a Google Form and automate what happens after submissions.
- Use when the user asks for email alerts, spreadsheet logging, or conditional handling of form responses.
- Use when the user wants Apps Script snippets to paste into a form bound script project.
- Skip this skill if the user needs custom UI, paid APIs, or a full standalone Apps Script application.
How It Works
Step 1: Define the form in the Forms UI
Create the form in Google Forms with clear questions, answer types (short answer, multiple choice, checkbox), and required fields. Match question IDs to what the script will need later. Add a description to the form so respondents know what to expect.
Step 2: Open the bound Apps Script editor
In the form, go to Extensions > Apps Script. This opens a project bound to the form. The script can read each submission through the e.response event object.
Step 3: Write the response handler
Add a function that accepts the onFormSubmit event, reads e.response with getItemResponses(), and then performs the desired action: send an email, write to a spreadsheet, or branch on answers.
Step 4: Install the trigger
In Apps Script, go to the clock/triggers menu, select the onFormSubmit function, choose the event source From form and event type On form submit, then save and authorize. The function runs automatically on each new submission.
Step 5: Test with a real submission
Submit a test response from a private/incognito window and verify the email, sheet row, or log arrives once. Check the Apps Script executions page (Executions in the editor) for errors and read the stack trace if something fails.
Examples
Example 1: Email notification on every response
function onFormSubmit(e) {
const response = e.response;
const email = getEmail(response);
MailApp.sendEmail({
to: email,
subject: "Form submission received",
body: "Thank you. We have recorded your response."
});
}
function getEmail(response) {
// Requires Forms' VERIFIED email collection, not an email question or responder input.
const form = FormApp.getActiveForm();
if (!form.collectsEmail()) throw new Error("Verified email collection is required");
// Configure the form to Verified in the UI; Apps Script's boolean alone does not prove it.
if (PropertiesService.getScriptProperties().getProperty("VERIFIED_EMAIL_COLLECTION_APPROVED") !== "yes") {
throw new Error("Owner must verify and approve the form's email-collection mode");
}
const email = response.getRespondentEmail();
if (!email || !/^[^\s,@]+@[^\s,@]+\.[^\s,@]+$/.test(email)) throw new Error("Missing verified recipient");
// Limit one receipt per verified address per six hours under an atomic script lock.
const lock = LockService.getScriptLock();
lock.waitLock(5000);
try {
const cache = CacheService.getScriptCache();
if (cache.get(email)) throw new Error("Receipt already sent");
if (MailApp.getRemainingDailyQuota() < 20) throw new Error("Mail quota reserve reached");
cache.put(email, "sent", 21600);
} finally { lock.releaseLock(); }
return email;
}Example 2: Log each response to a Google Sheet
function onFormSubmit(e) {
const sheet = SpreadsheetApp.openById(SHEET_ID).getSheetByName("Responses");
const itemResponses = e.response.getItemResponses();
const asText = value => {
const text = Array.isArray(value) ? value.join(", ") : String(value ?? "");
return /^[\s\u0000-\u001f]*[=+@-]/.test(text) ? "'" + text : text;
};
const row = [new Date()].concat(itemResponses.map(r => asText(r.getResponse())));
sheet.appendRow(row);
}Example 3: Branch on a multiple-choice answer
This fragment requires an approved fixed MANAGER_EMAIL and an itemResponsesText helper that includes only permitted non-sensitive fields. Trigger installation authorizes recurring sends and needs that explicit scope; no helper is bundled.
function onFormSubmit(e) {
const items = e.response.getItemResponses();
for (const item of items) {
if (item.getItem().getTitle().toLowerCase() === "priority") {
const priority = item.getResponse();
const subject = priority === "High" ? "[URGENT] " : "";
MailApp.sendEmail({ to: MANAGER_EMAIL, subject: subject + "New submission", body: itemResponsesText(e) });
}
}
}Best Practices
- ✅ Test every trigger with a real submission before telling the user it works.
- ✅ Use clear, stable question titles so the script can match items by title instead of fragile indexes.
- ✅ Keep secrets and API keys in script properties, never hard-coded in the file.
- ✅ Add try/catch around handler logic and log errors with
Logger.logso failures surface in the Executions page. - ❌ Do not grant broad scopes; run with the minimum permission the form action needs.
- ❌ Do not send email to addresses that the form did not legitimately collect.
Limitations
- Apps Script quotas apply (email rate limits, daily triggers, execution time); heavy volume needs review.
- Only form submissions trigger the event; edits to responses by users do not fire
onFormSubmitby default. - The skill produces scripts the user must paste, authorize, and deploy; it cannot create a Google Forms project by itself.
- Sheets integration requires the sheet's ID and permission, which must be confirmed with the user.
Security & Safety Notes
- The script runs inside the user's Google account with the scopes it declares. Review the authorization prompt and grant only the minimum requested scope.
- Do not log, print, or embed passwords, OAuth tokens, or API keys in form scripts or shared files.
- Form responses can arrive from anyone the form is shared with; validate inputs before acting on them.
- Test in a controlled environment first; sending email or appending rows happens on every submission once the trigger is live.
Common Pitfalls
- Problem: The handler runs for every submission and duplicates work.
Solution: Prefer the single event object e.response; do not separately query the form's stored responses inside onFormSubmit.
- Problem:
item.getResponse()returnsundefinedfor optional questions.
Solution: Guard with a check for a truthy response, or make the question required.
- Problem: The email goes to the wrong address.
Solution: Use verified respondent-email collection and the approved recipient policy; do not send to arbitrary addresses entered in a question.
Related Skills
@google-sheets-automation- Use when the response logging target is a Sheet that needs its own automation.@google-docs-automation- Use when form output should create or update a Google Doc.
Skill liên quan
- graphql-schema – Các mẫu truy vấn, mutation và sinh code GraphQL. Dùng khi tạo thao tác GraphQL, làm việc…
- grok-delegate – Chỉ giao tác vụ lập trình cho Grok Build CLI khi người dùng yêu cầu rõ ràng, trong khi…
- grpc-golang – Xây dựng dịch vụ gRPC sẵn sàng production trong Go với mTLS, streaming và observability…
- hasdata-cli – Truy cập qua dòng lệnh để tìm kiếm, thu thập dữ liệu web và lấy dữ liệu có cấu trúc.
- site-architecture – Khi người dùng muốn kiểm tra, thiết kế lại hoặc lên kế hoạch cấu trúc website, cấu trúc…
- skill-doctor – Dùng khi người dùng muốn chấm điểm thiết lập agent của mình dựa trên lịch sử hội thoại…
- hf-cli – Hướng dẫn upstream được tuyển chọn cho Hf Cli; dùng khi quy trình khớp với mục tiêu của…
- hig-components-controls – Chọn và đánh giá các điều khiển chọn và nhập liệu của Apple: toggle, segmented control…