Bỏ qua để đến nội dung

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.

NơiVí dụ
Formula columnThành tiền = Quantity * Price (formula columns)
Command barVisibility + OnSelect của nút (command bar)
Custom pageLogic giao diện canvas (custom pages)
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 ghi
Filter( Orders, CustomerId = ThisItem.Id ) // lọc
Navigate( DetailScreen ) // điều hướng

→ Trong custom page, Power Fx đọc/ghi Dataverse và điều khiển giao diện.

Nhu cầuCông cụ
Tính giá trị cộtFormula 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, emailPower Automate
Chia sẻ: