Power Automate | Read Text file
Power Automate | Read Text file
วิธีอ่านข้อมูลใน Text file ด้วย Power Automate Cloud Flows
เพื่อต้องเช็ค ข้อมูลใน Text file ว่าตรงกับเงื่อนไข ที่ต้องการมั้ย
1.Get file content
จะใช้
Gent file content หรือ Get file content using path ก็ได้ แล้วแต่ สถานการณ์
ถ้า รู้ path ก็ใช้ Get file content using path
ถ้าไม่รู้ path แต่ ดึงจาก Trigger ก็ใช้ File ID หรือ File Identifier
จากรูป กำหนด ไปเลยจะอ่าน file อะไร
2.ขั้นตอนหลัก คือ การอ่านข้อมูล
ด้วย Function String
2.1 คลิก + เพิ่ม Action -> Data Operation -> Compose
3.ที่ช่อง Inputs คลิกเลือก เขียน Expressions
4. Function ที่ใช้คือ String จะแปลง ข้อมูลให้ อยู่ในรูป Text
โดยพิมพ์ string ใส่วงเล็บ และ ไปคลิก
Dynamic Content และ คลิกเลือก File Content ของ Get file content using path
ผลลัพธ์จะเป็น เหมือนรูปที่สอง
5.สามารถใช้ Output ของ Compose ซึ่งเป็น ข้อความใน Text file ที่ดึงออกมาแล้วไปใช้ต่อได้เลย
จากรูปสามารถ ส่งข้อความเข้า Microsoft Teams ได้เลย