Power Automate Cloud Flows | Automatically download attachments
Power Automate Cloud Flows | Automatically download attachments
ถ้ามีงาน ที่ต้อง มานั่ง download attachments จาก email เช่น
จาก supplier หรือ จาก ลูกค้า ทุกๆ email
จะเสียเวลา เยอะ
เราสามารถใช้ Power Automate Cloud Flows ช่วย download attachments จาก email ที่ต้องการ
ไปเก็บใน Folder ได้เลย
พอสิ้นวัน ก็แค่มาเปิดดูใน Folder ที่ตั้งไว้
วิธีทำ
1 ไปที่ make.powerautomate.com
2 . Click Create -> เลือก Automated cloud flow
3 . ตั้งชื่อ และ เลือก Trigger ชื่อ When a new email arrives
( ต้องเลือกของ Office365 Outlook )
4 . คลิกที่ Trigger -> เลือก Show add -> เลือกเงื่อนไข ที่จะ run flow
ตัวอย่างจะเลือก เฉพาะ email ที่มีคำว่า PO และ มี attachments
เลยติ๊ก Subject Filer , Only with Attachments
5.ใส่เงื่อนไข
Subject Filter - > PO
Only with Attachments -> Yes
6.คลิก + เพิ่ม Action โดยเลือก Get Attachments ของ Office 365 Outlook
7. คลิก เลือก parameter ที่ต้องใส่
จาก dynamic contents โดยคลิก ที่สัญลักษณ์ สายฟ้า
Message ID - > เลือก Message ID จาก When a new email arrives
Attachment ID ->Attachments Attachment ID จาก When a new email arrives
8.หลังจากเลือกเสร็จ จะมี สัญลักษณ์ Loop ขึ้นมาให้เอง อัตโนมัติ
เพราะ Power Automate Cloud Flows จะ รู้ทันทีว่า attachments อาจจะมีมากกว่า 1 file
ก็จะวน loop ให้ครบทุกไฟล์
9.คลิกที่ ปุ่ม + ใน Loop เลือก
Create file ที่อยู่ใน OneDrive for Business
10.เลือก ตำแหน่ง ที่จะสร้าง file กับ Name และ ข้อมูล
Folder Path
ให้ใส่ path ของ OneDrive
เช่น Path ตามนี้
ให้ใส่ ตั้งแต่
/PAC_training/Power_Automate_Cloud/Download_Attachments
ได้เลย ( copy path จากใน OneDrive on Web ) ( หรือจะพิมพ์เองก็ได้ )
File Name ->เลือก Dynamic Contents ( สัญลักษณ์ สายฟ้า ) -> ใช้ Name จาก Get attachment
File Content -> เลือก Dynamic Contents ( สัญลักษณ์ สายฟ้า ) ->ใช้ Content Bytes จาก Get attachment
11.กด Save Flow
รอจนกว่า ข้อความ Your flow is read to go
ก็พร้อมใช้งานได้ทันที
ทันที ที่มี email เข้ามา แล้ว Subject มีคำว่า PO
Flow จะ run ทันที โดย download attachment ไปเก็บใน Folder ที่กำหนด
พอสิ้นวัน ก็แค่มาเปิดดู Folder