Power Fx trong model-driven
Power Fx là ngôn ngữ công thức giống Excel của Power Platform. Trong model-driven app, Power Fx xuất hiện ở formula columns, command bar và custom pages — mang sức mạnh low-code linh hoạt.
Power Fx dùng ở đâu trong MDA
Phần tiêu đề “Power Fx dùng ở đâu trong MDA”| Nơi | Ví dụ |
|---|---|
| Formula column | Thành tiền = Quantity * Price (formula columns) |
| Command bar | Visibility + OnSelect của nút (command bar) |
| Custom page | Logic giao diện canvas (custom pages) |
Cú pháp giống Excel
Phần tiêu đề “Cú pháp giống Excel”If( Status = 'Active', "Đang hoạt động", "Khác" )Text( Amount, "#,##0" ) & " ₫"DateDiff( Today(), DueDate, Days )- Hàm quen thuộc:
If,Switch,Text,Value,Concatenate/&, hàm ngày, hàm chuỗi. - Không cần biến/loop phức tạp — tư duy “công thức” như Excel.
Hàm thao tác dữ liệu (trong canvas/custom page)
Phần tiêu đề “Hàm thao tác dữ liệu (trong canvas/custom page)”Patch( Accounts, ThisItem, { Status: "Approved" } ) // cập nhật bản ghiFilter( Orders, CustomerId = ThisItem.Id ) // lọcNavigate( DetailScreen ) // điều hướng→ Trong custom page, Power Fx đọc/ghi Dataverse và điều khiển giao diện.
Power Fx vs business rule vs Power Automate
Phần tiêu đề “Power Fx vs business rule vs Power Automate”| Nhu cầu | Công cụ |
|---|---|
| Tính giá trị cột | Formula column (Power Fx) |
| Logic nút bấm (visibility/action) | Power Fx trên command |
| Logic form (ẩn/hiện/bắt buộc) | Business rule |
| Quy trình nền, tích hợp, email | Power Automate |