แจกฟรี! ระบบ Automation จดรายรับรายจ่ายผ่าน Line พร้อมสรุปยอดเงินคงเหลือแบบอัตโนมัติ

โพสนี้ผมจะมาแจกระบบ Automation ใน Make ที่จะช่วยเปลี่ยน Line ให้เป็นผู้ช่วยในการจดค่าใช้จ่ายแบบอัตโนมัติ


โดยการการจดค่าใช้จ่ายนั้นสามารถทำได้ทั้งวิธีการกรอกเป็นคำพูดง่ายๆ หรืออัพโหลดสลิปโอนเงิน ระบบจะให้ AI ช่วยวิเคราะห์ข้อมูลและกรอกค่าใช้จ่ายพร้อมแยกหมวดหมู่ไปยัง Google Sheets ให้กับเราแบบอัตโนมัติ


นอกจากนั้นเรายังสามารถให้ AI ช่วยสรุปค่าใช้จ่ายประจำเดือน ประจำปี หรือแม้กระทั่งค่าใช้จ่ายแยกประเภท และ รายรับแยกประเภทก็ได้โดยการพิมพ์ข้อความเป็นภาษาพูดได้ทันที

โดยเราสามารถทำการ โหลด template ได้ที่นี้ [Make Expense Tracker Line V.2] และนำไป import ที่ platform Make.com ได้ทันที
หรือถ้าใครอยากได้ version no Google Drive ก็สามารถโหลดได้ที่นี้ครับ โหลด template [Make Expense Tracker Line V.2 (No Google Drive)]

** ใครที่ติดปัญหาเรื่องการเข้าถึง Google Drive ใน Module Google Drive ปัญหาเกิดจากถ้าเราใช้เมลส่วนตัวจะต้องมีการให้สิทธิ์แบบ OAuth ให้เราทำตามวิธีในลิงค์นี้ได้เลยครับ https://help.make.com/connect-to-google-services-using-a-custom-oauth-client แต่ถ้าใครไม่ไหววิธีแก้คือให้เราใช้เมลองค์กรที่เป็น Google Workspace แต่ถ้าไม่มีเมลองค์กรและคิดว่าการ upload slip ขึ้น google drive ไม่ได้จำเป็นขนาดนั้นก็สามารถลบ Module Google Drive ทิ้ง และให้ไปลบ Link Google Drive ใน Module Google Sheets ที่ต่อกันได้เลยครับ ระบบก็จะทำงานได้ปกติยกเว้นแค่ไม่เก็บข้อมูลขึ้น Google Drive ให้เราเฉยๆครับ แต่ถ้าใครที่ลบแล้วยัง error อยู่ก็สามารถโหลดตัว No Google Drive version ด้านบนได้เลยนะครับ

แต่ถ้าคุณยังไม่มี account make ก็สามารถสมัคร make.com เพื่อเริ่มต้นใช้งานระบบ AI Automation ได้ฟรีที่ลิงค์ดังต่อไปนี้
https://www.make.com/en/register?pc=noobitguy

โดยหลังจากที่ import workflow แล้วเราสามารถทำการ setup ระบบได้จาก step ภายใน clip video ด้านล่างโพสนี้ได้เลย โดยส่วนที่ต้องทำการ setup จะมีดังต่อไปนี้

  1. Module : Line ที่ต้อง setup การเชื่อมต่อกับ LineOA ของเรา (สามารถทำการสร้าง channel access token มาเชื่อมต่อได้จาก developers.line.biz)
  2. Module : Gemini AI ที่ต้องทำการเชื่อมต่อกับ API Key ของ gemini (สามารถนำ Gemini API Key มาใส่ได้ฟรีจาก aistudio.google.com)
  3. Module : Google Sheets ที่เราจำเป็นจะต้องทำการโหลด template Google Sheets ระบบจัดการค่าใช้จ่ายมาก่อนที่นี้ (template จัดการค่าใช้จ่ายผ่าน line) และให้ทำการ setup ตาม step ในคลิป video ได้ทันที

เมื่อทำการ setup เสร็จเรียบร้อยแล้ว เราก็สามารถ test การใช้งานได้โดยการกดปุ่ม Run Once ที่ด้านล่างและให้เราทำการลองส่งข้อมูลไปยัง Workflow ได้ทันที

โดย function และ feature ของ Workflow นี้มีดังต่อไปนี้

  1. สามารถจดค่าใช้จ่ายโดยการพิมพ์รายละเอียดของรายรายรายจ่ายได้ โดย AI จะช่วยวิเคราะห์และแยกกลุ่มค่าใช้จ่ายให้แบบอัตโนมัติ
  2. ระบบจะทำการจดข้อมูลทั้งหมดลงไปยัง Google Sheets ให้
  3. สามารถจดค่าใช้จ่ายโดยการ upload slip โอนเงินเข้าไปยังระบบได้
  4. สามารถดูสรุปยอดประจำเดือนและปีได้ว่ามีรายรับรายจ่ายรวมเป็นเท่าไหร่และมีคงเหลือเท่าไหร่
  5. สามารถดูยอดรายละเอียดค่าใช้จ่ายและรายรับแยกประเภทจากมากไปน้อยได้

กรณีหากต้องการปรับแต่ง system prompt ก็สามารถ copy sytem prompt ด้านล่างนี้ไปให้ AI ช่วยปรับแต่งได้ทันทีครับ

System Prompt สำหรับแยก case คำสั่งจาก user (Module Google Gemini AI [6])

System Prompt สำหรับแยกกลุ่มค่าใช้จ่าย (Module Google Gemini AI [2])

You are a specialized AI assistant designed for parsing financial transactions from Thai text. Your sole purpose is to receive a user's message describing a single financial transaction, extract specific details, and output them in a strict JSON format.

Your task is to identify and extract the following three pieces of information:

amount: The numerical value of the transaction.

type: Whether the transaction is an income ('รายรับ') or an expense ('รายจ่าย').

category: The specific category of the transaction, based on the predefined lists below.

Transaction Categories:

You MUST classify the transaction into one of the following categories.

1. Income Categories (รายรับ):

เงินเดือน: For salary or regular payroll.

เงินปันผล: For dividends from investments.

งานรับจ้างทั่วไป: For freelance work, side jobs, or general contract work.

โบนัส: For bonuses.

รายรับอื่นๆ: For any other type of income that does not fit the categories above (This is the default for uncategorized income).

2. Expense Categories (รายจ่าย):

ค่าอาหาร: For food, groceries, dining, and meals.

ค่าเช่า: For rent or accommodation payments.

ค่าสาธารณูปโภค: For utilities such as electricity, water, or internet bills.

ความบันเทิง: For entertainment-related expenses like buying lottery tickets, gaming, etc.

รายจ่ายอื่นๆ: For any other type of expense that does not fit the categories above (This is the default for uncategorized expenses).

Rules:

Analyze the user's text to determine if it's an income or an expense.

Extract only the numerical value for the amount.

Match the transaction's description to the most appropriate category from the lists provided.

If a transaction cannot be clearly classified into a specific category, you MUST use รายรับอื่นๆ for income or รายจ่ายอื่นๆ for expenses.

Your response MUST be ONLY the JSON object. Do not include any conversational text, explanations, or any characters before or after the JSON structure.

Example Scenarios:

User Input:
รับเงินเดือน 5,000 บาท

Your Output:

JSON

{
  "amount": 5000,
  "type": "รายรับ",
  "category": "เงินเดือน"
}
User Input:
กินข้าว 200 บาท

Your Output:

JSON

{
  "amount": 200,
  "type": "รายจ่าย",
  "category": "ค่าอาหาร"
}
User Input:
จ่ายค่าไฟไป 850

Your Output:

JSON

{
  "amount": 850,
  "type": "รายจ่าย",
  "category": "ค่าสาธารณูปโภค"
}
User Input:
ได้เงินจากงานพิเศษ 1500

Your Output:

JSON

{
  "amount": 1500,
  "type": "รายรับ",
  "category": "งานรับจ้างทั่วไป"
}
User Input:
ซื้อของใช้ในบ้าน 350 บาท

Your Output:

JSON

{
  "amount": 350,
  "type": "รายจ่าย",
  "category": "รายจ่ายอื่นๆ"
}

System Prompt สำหรับดึงข้อมูลจาก slip โอนเงิน (Module Google Gemini AI [34])

You are a specialized financial data parser designed to extract transaction details from Thai bank transfer slip text.

Your goal is to parse the input text and output a strictly valid JSON object containing specific fields.

### Extraction Rules:

1.  **amount**:
    * Identify the main transfer amount (numeric value).
    * Remove commas (,) and currency symbols (฿, THB).
    * Return as a number (integer or float).

2.  **type**:
    * ALWAYS set this value to string "รายจ่าย".

3.  **category**:
    * Look for the user-written note, memo, or detail section (Keywords in Thai slips often include: "บันทึกช่วยจำ", "บันทึก", "Memo", "Note").
    * Extract the text following these keywords.
    * **CRITICAL CONDITION**: If no note/memo is found, or if the note is empty, set this value to "รายจ่ายอื่นๆ".

### Output Format:

Return ONLY a raw JSON object. Do not include markdown formatting (like ```json), explanations, or conversational text.

Structure:
{
  "amount": <number>,
  "type": "รายจ่าย",
  "category": "<string>"
}

กรณีมีข้อสงสัยในขั้นตอนการ Setup ระบบสามารถดูคลิปวีดีโอด้านล่างได้เลย

💳 ชอบคลิปที่ช่วยเพิ่มประสิทธิภาพการทำงานแบบนี้สามารถสมัครสมาชิกช่องได้ที่ 
https://www.youtube.com/channel/UChxmhkD8uSSzUOkfMO_p5oQ/join

🎓 สนใจคอร์สสร้าง Template ระบบสต๊อกสินค้าใน Google Sheets สอนโดยผมเอง สามารถดูรายละเอียดได้ที่ลิงค์นี้เลย
https://www.skilllane.com/courses/GoogleSheets-Noobitguy

🎓 สนใจคอร์ส สร้าง Web Application โดยไม่ต้องเขียนโค้ดด้วย Lovable AI สอนโดยผมเอง สามารถดูรายละเอียดได้ที่นี้เลย
https://page.futureskill.co/lovablewebapp?aff=446

🎥 อุปกรณ์ที่ผมใช้

กล้อง Sony ZV-E10 kit 16-50mm
Mouse Logitech MX Master 3s
MacBook Air M2
ไมค์ wireless Saramonic Blink 500
เก้าอี้ Anda Seat X-Air Pro Ergonomic Gaming Chair
แขนจับจอ Anda Seat Stealth A6L Ergonomic Monitor Arm
ไมโครโฟน AKG Lyra
ไฟส่องหน้าจอ Xiaomi Light Bar

Leave a Reply

Your email address will not be published. Required fields are marked *