Google Drive Trigger node common issues#
รวม error และปัญหาที่พบบ่อยกับ Google Drive Trigger node พร้อมวิธีแก้ไขหรือแนวทางตรวจสอบ
401 unauthorized error#
ข้อความ error เต็มจะประมาณนี้:
1 |
|
error นี้เกิดจาก credential ที่ใช้มีปัญหาเรื่อง scope หรือ permission
วิธีแก้ไข:
- ถ้าใช้ OAuth2 credential ให้แน่ใจว่าได้เปิด Google Drive API ใน APIs & Services > Library แล้ว ดูวิธีเปิดได้ที่ Google OAuth2 Single Service - Enable APIs
- ถ้าใช้ Service Account credential:
- Enable domain-wide delegation
- ตรวจสอบว่าได้เพิ่ม Google Drive API ใน domain-wide delegation configuration แล้ว
Handling more than one file change#
Google Drive Trigger node จะ poll Google Drive เพื่อเช็คการเปลี่ยนแปลงตามช่วงเวลาที่ตั้งไว้ (default คือทุก 1 นาที)
ถ้ามีการเปลี่ยนแปลงหลายไฟล์ที่ตรงกับ Watch For criteria ในช่วง polling เดียว จะเกิด event เดียวที่รวมการเปลี่ยนแปลงทั้งหมดเป็น items ดังนั้น workflow ของคุณต้องรองรับกรณีที่ข้อมูลมีมากกว่า 1 item
คุณสามารถใช้ if node หรือ switch node เพื่อเปลี่ยนพฤติกรรม workflow ตามจำนวน item ที่ได้จาก Google Drive Trigger node