Power Apps | Image control แสดง รูปล่าสุด จาก Attachments
Power Apps | Image control แสดง รูปล่าสุด จาก Attachments
ใน Edit Form มี Image control ไว้แสดงรูป จาก column Image ใน SharePoint List
แต่ถ้า อยากจะให้ Image control นี้
แสดง รูป ล่าสุด ที่ถูกถ่าย จาก กล้อง
โดยเก็บไว้ใน column Attachments
เขียนสูตรโดยใช้
ฟังก์ชั่นชื่อ Last ได้เลย
จากตัวอย่าง
control ที่แสดง attachment ชื่อ DataCardValue17
Last จะเป็น function ใช้ดึง รายการ ล่าสุดใน Table มาแสดงผล
โดย column Attachments ใน SharePoint List
จะเป็บข้อมูลลักษณะเป็น Table
การเก็บข้อมูลใน column Attachments
จะเป็น เป็น Table อีกที หนึ่ง
จากตัวอย่างรูปด้านล่าง
Record 101
มี การเก็บ data ใน column Attachments 3 ไฟล์
จะมีการเก็บข้อมูล เป็นตารางย่อยอีกที ใน column Attachments
โดย มี 2 column
Name -> เก็บชื่อไฟล์
Value -> เก็บ ข้อมูล
Last(DataCardValue17.Attachments).Name - > จะได้ชื่อไฟล์ ล่าสุด
Last(DataCardValue17.Attachments).Value -> จะได้ รูป หรือ ไฟล์ ล่าสุด
แต่ถ้าต้องการระบุุ รายการที่ต้องการใช้
สามารถใช้ index function ได้
ต้วอย่างด้านล่าง
คือ ดึงชื่อไฟล์ที่ 2 มาแสดงผล
Index(ชื่อTable,ลำดับข้อมูล).ชื่อColumn
Index(DataCardValue17.Attachments,2).Name
จากตัวอย่าง
control ที่แสดง attachment ชื่อ DataCardValue17
Last จะเป็น function ใช้ดึง รายการ ล่าสุดใน Table มาแสดงผล
โดย column Attachments ใน SharePoint List
จะเป็บข้อมูลลักษณะเป็น Table