powerapp-sample-requests/
├── App.pa.yaml # App.OnStart, variables, colors, navigation
├── HomeScreen.pa.yaml # Dashboard với stats cards + quick actions
├── SalesScreen.pa.yaml # Form tạo/sửa YC + danh sách của Sales
├── QCScreen.pa.yaml # Hàng đợi QC + dialog xác nhận
├── LogisticsScreen.pa.yaml # Xử lý gửi hàng + dialog shipping
└── DetailScreen.pa.yaml # Chi tiết YC + timeline
- Mở Power Apps Studio tại: https://make.powerapps.com
- Mở app hiện tại của anh
- Enable coauthoring: Settings > Updates > Coauthoring = ON
Import App.OnStart:
- Vào Tree view > Chọn App
- Trong Formula bar, paste toàn bộ nội dung từ
App.pa.yamlvào propertyOnStart - Click Run OnStart (biểu tượng play) để apply
Import từng Screen:
- Tạo screen mới: Insert > Screen > Blank
- Đổi tên screen theo file (HomeScreen, SalesScreen, etc.)
- Trong Tree view, chọn screen mới tạo
- Copy nội dung từ file
.pa.yamlvà paste vào các controls
Nếu anh muốn tôi code trực tiếp vào Power Apps Studio:
- Mở app trong Power Apps Studio
- Enable coauthoring (như trên)
- Gửi lại Environment ID + App ID cho tôi
- Tôi sẽ kết nối và apply code trực tiếp
Nếu anh muốn import toàn bộ app:
- Trong Power Apps Studio, click File > Open > Browse
- Chọn file
.msappđã export - Hoặc sử dụng Power Apps CLI:
pac solution import --path ./solution.zip
Sau khi import, anh cần kết nối lại SharePoint list:
- Vào Data (panel trái)
- Xóa connection cũ (nếu có)
- Thêm connection mới: + Add data > SharePoint
- Chọn site
https://nafoodsvn.sharepoint.com/sites/3PLcost - Chọn list
SampleRequests
Trong App.OnStart, cập nhật email cho đúng:
Set(varRole,
Switch(varUserEmail,
"email1@nafoods.com", "Sales",
"email2@nafoods.com", "QC",
"email3@nafoods.com", "Logistics",
"admin@nafoods.com", "Admin",
"Admin" // Default
)
);
Trong Power Apps Studio:
- Vào Settings > Display
- Tắt:
- Scale to fit = OFF
- Lock aspect ratio = OFF
- Lock orientation = OFF
- Click Apply
Để UI đẹp hơn:
- Vào Settings > Updates > New
- Bật Modern controls and themes
Sau khi import xong, test theo checklist:
- App mở ra màn hình Home
- Sidebar hiển thị trên desktop
- Stats cards hiển thị đúng số liệu
- Nút "Tạo YC Mới" hoạt động (Sales)
- Form tạo YC hiển thị đúng
- Save button lưu vào SharePoint
- QC screen hiển thị hàng đợi
- QC có thể bắt đầu xử lý
- QC có thể xác nhận mẫu ready
- Logistics screen hiển thị chờ gửi
- Dialog gửi hàng hoạt động
- Tracking button mở link đúng
- Detail screen hiển thị đúng info
- Timeline hiển thị đúng progress
- Responsive: resize browser thấy layout thay đổi
| Vấn đề | Giải pháp |
|---|---|
| SharePoint connection error | Kiểm tra site URL và list name |
| Delegation warning | Giới hạn 500 rows, hoặc dùng Dataverse |
| Modern controls không hiện | Enable trong Settings > Updates |
| Responsive không hoạt động | Tắt Scale to fit trong Settings |
| Role detection sai | Kiểm tra email trong App.OnStart |
Nếu cần hỗ trợ thêm:
- Gửi screenshot lỗi
- Mô tả bước thực hiện
- Kiểm tra console browser (F12)