powerapps-yaml
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePower Apps YAML — Guía Completa para Vibe Coding
Power Apps YAML — 流畅无错编码完整指南
Cuándo usar
适用场景
- Al generar código YAML para pegar en Power Apps Studio
- Al crear o modificar pantallas de Power Apps
- Al convertir diseños a controles Power Apps modernos
- Al trabajar con SharePoint como backend
- 生成可粘贴到Power Apps Studio的YAML代码时
- 创建或修改Power Apps屏幕时
- 将设计转换为Power Apps现代控件时
- 使用SharePoint作为后端时
🔑 Estructura Base (pa.yaml Schema v3)
🔑 基础结构(pa.yaml Schema v3)
La estructura OBLIGATORIA para que Power Apps Studio acepte el YAML via "Paste code":
yaml
Screens:
NombrePantalla:
Properties:
Fill: =SurfaceAlt
OnVisible: |-
=Set(varEjemplo, "hola")
Children:
- NombreControl:
Control: TipoControl
Variant: VarianteOpcional
Properties:
X: =0
Y: =0
Width: =Parent.Width
Height: =100
Children:
- ControlHijo:
Control: Text
Properties:
Text: ="Hola mundo"Power Apps Studio通过「粘贴代码」功能接受YAML的必填结构:
yaml
Screens:
NombrePantalla:
Properties:
Fill: =SurfaceAlt
OnVisible: |-
=Set(varEjemplo, "hola")
Children:
- NombreControl:
Control: TipoControl
Variant: VarianteOpcional
Properties:
X: =0
Y: =0
Width: =Parent.Width
Height: =100
Children:
- ControlHijo:
Control: Text
Properties:
Text: ="Hola mundo"Reglas de estructura
结构规则
- Top-level: Siempre empieza con
Screens: - Screen name: Debe coincidir EXACTAMENTE con el nombre de la pantalla en Power Apps Studio
- No usar : Las pantallas se definen directamente bajo
Control: Screen, SIN propiedadScreens:Control - Children es un array: Cada hijo comienza con
- NombreControl: - Control y Variant: Se definen dentro de cada hijo, NO en la pantalla
- Valores con : TODAS las propiedades llevan
=al inicio:=,Text: ="Hola"X: =0
- 顶层节点:必须以开头
Screens: - 屏幕名称:必须与Power Apps Studio中的屏幕名称完全一致
- 请勿使用:屏幕直接定义在
Control: Screen下,无需Screens:属性Control - Children为数组:每个子控件以开头
- NombreControl: - Control与Variant:定义在每个子控件中,而非屏幕节点
- 值需带:所有属性值必须以
=开头,例如=、Text: ="Hola"X: =0
🚨 Propiedades de Controles Modernos (CRÍTICO)
🚨 现代控件属性(关键)
Power Apps usa controles modernos que tienen nombres DIFERENTES a los clásicos. Usar los nombres incorrectos produce error .
PA2108: Unknown propertyPower Apps使用现代控件,其属性名称与传统控件不同。使用错误名称会触发错误。
PA2108: Unknown propertyControl Text
(Label)
TextText控件(标签)
| ❌ Clásico (NO usar) | ✅ Moderno (USAR) |
|---|---|
| |
| |
yaml
- lblEjemplo:
Control: Text
Properties:
X: =0
Y: =0
Width: =200
Height: =40
Text: ="Hola"
FontColor: =RGBA(0, 0, 0, 1)
Size: =14
Weight: =FontWeight.Bold
Align: =Align.Center
VerticalAlign: =VerticalAlign.Middle| ❌ 传统属性(请勿使用) | ✅ 现代属性(推荐使用) |
|---|---|
| |
| |
yaml
- lblEjemplo:
Control: Text
Properties:
X: =0
Y: =0
Width: =200
Height: =40
Text: ="Hola"
FontColor: =RGBA(0, 0, 0, 1)
Size: =14
Weight: =FontWeight.Bold
Align: =Align.Center
VerticalAlign: =VerticalAlign.MiddleControl Button
ButtonButton控件
| ❌ Clásico (NO usar) | ✅ Moderno (USAR) |
|---|---|
| |
| |
| |
| (no existe, usa Fluent theme) |
yaml
- btnEjemplo:
Control: Button
Properties:
X: =0
Y: =0
Width: =200
Height: =44
Text: ="Click"
BasePaletteColor: =BrandAccent
FontColor: =TextOnAccent
FontSize: =14
FontWeight: =FontWeight.Semibold
Appearance: ='ButtonCanvas.Appearance'.Primary
OnSelect: =Notify("Clickeado")Valores de Appearance:
- — botón principal
'ButtonCanvas.Appearance'.Primary - — botón secundario
'ButtonCanvas.Appearance'.Secondary - — transparente (ideal para overlays y back buttons)
'ButtonCanvas.Appearance'.Transparent
| ❌ 传统属性(请勿使用) | ✅ 现代属性(推荐使用) |
|---|---|
| |
| |
| |
| (无此属性,使用Fluent主题) |
yaml
- btnEjemplo:
Control: Button
Properties:
X: =0
Y: =0
Width: =200
Height: =44
Text: ="Click"
BasePaletteColor: =BrandAccent
FontColor: =TextOnAccent
FontSize: =14
FontWeight: =FontWeight.Semibold
Appearance: ='ButtonCanvas.Appearance'.Primary
OnSelect: =Notify("Clickeado")Appearance可选值:
- — 主按钮
'ButtonCanvas.Appearance'.Primary - — 次按钮
'ButtonCanvas.Appearance'.Secondary - — 透明按钮(适用于覆盖层和返回按钮)
'ButtonCanvas.Appearance'.Transparent
Control TextInput
TextInputTextInput控件
| ❌ Clásico (NO usar) | ✅ Moderno (USAR) |
|---|---|
| |
| (no existe en moderno) |
| (no existe en moderno) |
yaml
- txtEjemplo:
Control: TextInput
Properties:
X: =0
Y: =0
Width: =200
Height: =44
Value: =""
Mode: =TextMode.MultiLine # Opcional| ❌ 传统属性(请勿使用) | ✅ 现代属性(推荐使用) |
|---|---|
| |
| (现代控件无此属性) |
| (现代控件无此属性) |
yaml
- txtEjemplo:
Control: TextInput
Properties:
X: =0
Y: =0
Width: =200
Height: =44
Value: =""
Mode: =TextMode.MultiLine # 可选Control DatePicker
DatePickerDatePicker控件
| ❌ Clásico (NO usar) | ✅ Moderno (USAR) |
|---|---|
| |
yaml
- dpEjemplo:
Control: DatePicker
Properties:
X: =0
Y: =0
Width: =200
Height: =44
SelectedDate: =Today()| ❌ 传统属性(请勿使用) | ✅ 现代属性(推荐使用) |
|---|---|
| |
yaml
- dpEjemplo:
Control: DatePicker
Properties:
X: =0
Y: =0
Width: =200
Height: =44
SelectedDate: =Today()Control Dropdown
DropdownDropdown控件
yaml
- ddEjemplo:
Control: Dropdown
Properties:
X: =0
Y: =0
Width: =200
Height: =44
Items: =["Opción 1", "Opción 2", "Opción 3"]
DefaultSelectedItems: =["Opción 1"]
OnChange: =Set(varSeleccion, Self.Selected.Value)Para items numéricos:
yaml
Items: =Sequence(24, 0) # 0 a 23
Items: =[0, 5, 10, 15, 20, 25, 30] # Lista explícitayaml
- ddEjemplo:
Control: Dropdown
Properties:
X: =0
Y: =0
Width: =200
Height: =44
Items: =["Opción 1", "Opción 2", "Opción 3"]
DefaultSelectedItems: =["Opción 1"]
OnChange: =Set(varSeleccion, Self.Selected.Value)数字类型选项:
yaml
Items: =Sequence(24, 0) # 0至23
Items: =[0, 5, 10, 15, 20, 25, 30] # 显式列表Control GroupContainer
GroupContainerGroupContainer控件
| ❌ NO soportado | ✅ Alternativa |
|---|---|
| Usar un Button overlay transparente dentro del container |
| (no existe en modernos) |
yaml
- containerEjemplo:
Control: GroupContainer
Variant: ManualLayout
Properties:
X: =0
Y: =0
Width: =200
Height: =100
Fill: =Surface
DropShadow: =DropShadow.LightPara hacer un container clickeable:
yaml
Children:
- lblContenido:
Control: Text
Properties:
Text: ="Mi contenido"
- btnOverlay:
Control: Button
Properties:
X: =0
Y: =0
Width: =Parent.Width
Height: =Parent.Height
Text: =""
Appearance: ='ButtonCanvas.Appearance'.Transparent
OnSelect: =Navigate(OtraPantalla, ScreenTransition.None)| ❌ 不支持属性 | ✅ 替代方案 |
|---|---|
| 在容器内添加透明Button覆盖层 |
| (现代控件无此属性) |
yaml
- containerEjemplo:
Control: GroupContainer
Variant: ManualLayout
Properties:
X: =0
Y: =0
Width: =200
Height: =100
Fill: =Surface
DropShadow: =DropShadow.Light实现可点击容器:
yaml
Children:
- lblContenido:
Control: Text
Properties:
Text: ="Mi contenido"
- btnOverlay:
Control: Button
Properties:
X: =0
Y: =0
Width: =Parent.Width
Height: =Parent.Height
Text: =""
Appearance: ='ButtonCanvas.Appearance'.Transparent
OnSelect: =Navigate(OtraPantalla, ScreenTransition.None)📊 Gallery — Reglas Críticas
📊 Gallery — 关键规则
Regla #1: Variant es OBLIGATORIO
规则1:Variant为必填项
yaml
- galEjemplo:
Control: Gallery
Variant: BrowseLayout_Flexible_SocialFeed_ver5.0 # OBLIGATORIOError si falta:
PA1011: The keyword 'Variant' is required but is missing or emptyyaml
- galEjemplo:
Control: Gallery
Variant: BrowseLayout_Flexible_SocialFeed_ver5.0 # 必填缺失时错误:
PA1011: The keyword 'Variant' is required but is missing or emptyRegla #2: Items de SharePoint directo → funciona bien
规则2:直接绑定SharePoint列表项 → 兼容性良好
yaml
Items: =MiListaSPyaml
Items: =MiListaSPRegla #3: Items de colección → usar ForAll con esquema explícito
规则3:绑定集合项 → 使用带显式Schema的ForAll
⚠️ PROBLEMA: Cuando apunta a una colección creada con , los controles dentro de la gallery muestran errores ❌ porque Power Apps no puede inferir el esquema.
ItemsGroupBy + AddColumns✅ SOLUCIÓN: Usar con registros de forma explícita :
ForAll{campo: valor}yaml
OnVisible: |-
=ClearCollect(
colRanking,
ForAll(
GroupBy(colRegistros, Title, Email, Registros),
{
Nombre: ThisRecord.Title,
EmailUsuario: ThisRecord.Email,
Puntos: Sum(Registros, Puntos),
Sesiones: CountRows(Registros)
}
)
)⚠️ 问题:当指向通过创建的集合时,Gallery内的控件会显示错误 ❌,因为Power Apps无法推断其Schema。
ItemsGroupBy + AddColumns✅ 解决方案:使用创建显式记录:
ForAll{campo: valor}yaml
OnVisible: |-
=ClearCollect(
colRanking,
ForAll(
GroupBy(colRegistros, Title, Email, Registros),
{
Nombre: ThisRecord.Title,
EmailUsuario: ThisRecord.Email,
Puntos: Sum(Registros, Puntos),
Sesiones: CountRows(Registros)
}
)
)Regla #4: GroupBy — NO usar comillas en columnas
规则4:GroupBy — 列名请勿加引号
undefinedundefined❌ MAL — "Registros" se interpreta como texto
❌ 错误 — "Registros"会被解析为文本
GroupBy(tabla, "Title", "Email", "Registros")
GroupBy(tabla, "Title", "Email", "Registros")
✅ BIEN — identificadores sin comillas
✅ 正确 — 标识符无需引号
GroupBy(tabla, Title, Email, Registros)
undefinedGroupBy(tabla, Title, Email, Registros)
undefinedRegla #5: No agrupar por columnas que cambian
规则5:请勿按可变列分组
Si un usuario puede cambiar de equipo, NO agrupar por porque aparecerá duplicado. Tomar el equipo del último registro:
EquipoEquipoUsuario: Last(Registros).Equipo如果用户可切换团队,请勿按分组,否则会出现重复项。应取最新记录的团队信息:
EquipoEquipoUsuario: Last(Registros).EquipoRegla #6: Acceder a tabla agrupada dentro de ForAll
规则6:在ForAll中访问分组表
undefinedundefined❌ MAL — ThisRecord.Registros no resuelve
❌ 错误 — ThisRecord.Registros无法解析
Sum(ThisRecord.Registros, Puntos)
Sum(ThisRecord.Registros, Puntos)
✅ BIEN — acceso directo a la columna de grupo
✅ 正确 — 直接访问分组列
Sum(Registros, Puntos)
undefinedSum(Registros, Puntos)
undefinedTemplate completo para Gallery con colección:
集合绑定Gallery完整模板:
yaml
- galRanking:
Control: Gallery
Variant: BrowseLayout_Flexible_SocialFeed_ver5.0
Properties:
X: =16
Y: =188
Width: =Parent.Width - 32
Height: =Parent.Height - 204
Items: =SortByColumns(colRanking, "Puntos", SortOrder.Descending)
TemplatePadding: =6
TemplateSize: =80
Fill: =RGBA(0, 0, 0, 0)
Children:
- CardItem:
Control: GroupContainer
Variant: ManualLayout
Properties:
Width: =Parent.Width
Height: =74
Fill: =Surface
DropShadow: =DropShadow.Light
Children:
- lblNombre:
Control: Text
Properties:
X: =16
Y: =12
Width: =Parent.Width - 140
Height: =24
Text: =ThisItem.Nombreyaml
- galRanking:
Control: Gallery
Variant: BrowseLayout_Flexible_SocialFeed_ver5.0
Properties:
X: =16
Y: =188
Width: =Parent.Width - 32
Height: =Parent.Height - 204
Items: =SortByColumns(colRanking, "Puntos", SortOrder.Descending)
TemplatePadding: =6
TemplateSize: =80
Fill: =RGBA(0, 0, 0, 0)
Children:
- CardItem:
Control: GroupContainer
Variant: ManualLayout
Properties:
Width: =Parent.Width
Height: =74
Fill: =Surface
DropShadow: =DropShadow.Light
Children:
- lblNombre:
Control: Text
Properties:
X: =16
Y: =12
Width: =Parent.Width - 140
Height: =24
Text: =ThisItem.Nombre🚀 Patrón de Caché Local (Optimización)
🚀 本地缓存模式(优化)
Problema
问题
Cada pantalla hace queries independientes a SharePoint → lento y redundante.
每个屏幕独立查询SharePoint → 速度慢且冗余。
Solución: Centro de caché en Screen_Inicio
解决方案:在Screen_Inicio设置缓存中心
yaml
undefinedyaml
undefinedScreen_Inicio.OnVisible — carga datos UNA VEZ
Screen_Inicio.OnVisible — 仅加载一次数据
OnVisible: |-
=Set(varUsuarioActual, User().FullName);
Set(varEmailActual, User().Email);
ClearCollect(
colRegistrosMes,
Filter(
MiListaSP,
Month(Fecha) = Month(Today()),
Year(Fecha) = Year(Today())
)
);
Set(varMisRegistros, Filter(colRegistrosMes, Email = varEmailActual));
Set(varMiEquipo, LookUp(Miembros, Email = varEmailActual, Equipo))
undefinedOnVisible: |-
=Set(varUsuarioActual, User().FullName);
Set(varEmailActual, User().Email);
ClearCollect(
colRegistrosMes,
Filter(
MiListaSP,
Month(Fecha) = Month(Today()),
Year(Fecha) = Year(Today())
)
);
Set(varMisRegistros, Filter(colRegistrosMes, Email = varEmailActual));
Set(varMiEquipo, LookUp(Miembros, Email = varEmailActual, Equipo))
undefinedReutilizar en otras pantallas
在其他屏幕复用缓存
yaml
undefinedyaml
undefinedScreen_Ranking — usa colRegistrosMes, NO re-consulta SharePoint
Screen_Ranking — 使用colRegistrosMes,无需重新查询SharePoint
OnVisible: |-
=ClearCollect(
colRanking,
ForAll(
GroupBy(colRegistrosMes, Title, Email, Registros),
{ Nombre: ThisRecord.Title, Puntos: Sum(Registros, Puntos) }
)
)
OnVisible: |-
=ClearCollect(
colRanking,
ForAll(
GroupBy(colRegistrosMes, Title, Email, Registros),
{ Nombre: ThisRecord.Title, Puntos: Sum(Registros, Puntos) }
)
)
Screen_Equipos — usa varMiEquipo ya cacheado
Screen_Equipos — 使用已缓存的varMiEquipo
OnVisible: |-
=Set(varVistaEquipos, "Lista")
# varMiEquipo ya está cargado desde Screen_Inicio
undefinedOnVisible: |-
=Set(varVistaEquipos, "Lista")
# varMiEquipo已从Screen_Inicio加载完成
undefinedDespués de guardar un registro — actualizar caché local
保存记录后 — 更新本地缓存
yaml
undefinedyaml
undefinedEn btnGuardar.OnSelect, después del Patch:
在btnGuardar.OnSelect中,执行Patch后添加:
Patch(MiListaSP, Defaults(MiListaSP), { ... });
Collect(colRegistrosMes, { ...mismo registro... });
Navigate(Screen_Inicio, ScreenTransition.None)
**Resultado**: ~7 queries SP → **2 queries** (1 ClearCollect + 1 LookUp)
---Patch(MiListaSP, Defaults(MiListaSP), { ... });
Collect(colRegistrosMes, { ...相同记录... });
Navigate(Screen_Inicio, ScreenTransition.None)
**优化结果**:约7次SP查询 → **2次查询**(1次ClearCollect + 1次LookUp)
---🎨 Colores del Tema (App.Formulas)
🎨 主题颜色(App.Formulas)
Definir paleta global en :
App > FormulasBrandPrimary = RGBA(30, 41, 59, 1);
BrandAccent = RGBA(255, 107, 53, 1);
BrandAccentLight = RGBA(255, 107, 53, 0.08);
Surface = RGBA(255, 255, 255, 1);
SurfaceAlt = RGBA(245, 247, 252, 1);
TextPrimary = RGBA(15, 23, 42, 1);
TextSecondary = RGBA(100, 116, 139, 1);
TextOnAccent = RGBA(255, 255, 255, 1);
StatusSuccess = RGBA(16, 185, 129, 1);
StatusWarning = RGBA(234, 179, 8, 1);
StatusError = RGBA(239, 68, 68, 1);在中定义全局调色板:
App > FormulasBrandPrimary = RGBA(30, 41, 59, 1);
BrandAccent = RGBA(255, 107, 53, 1);
BrandAccentLight = RGBA(255, 107, 53, 0.08);
Surface = RGBA(255, 255, 255, 1);
SurfaceAlt = RGBA(245, 247, 252, 1);
TextPrimary = RGBA(15, 23, 42, 1);
TextSecondary = RGBA(100, 116, 139, 1);
TextOnAccent = RGBA(255, 255, 255, 1);
StatusSuccess = RGBA(16, 185, 129, 1);
StatusWarning = RGBA(234, 179, 8, 1);
StatusError = RGBA(239, 68, 68, 1);⏰ Patrón: Selector de Hora con Dropdowns
⏰ 模式:使用Dropdown实现时间选择器
El solo selecciona fecha. Para hora, usar pares de Dropdowns:
DatePickeryaml
undefinedDatePickeryaml
undefinedHoras (0-23)
小时(0-23)
- ddHoraH: Control: Dropdown Properties: Items: =Sequence(24, 0) DefaultSelectedItems: =[8]
- ddHoraH: Control: Dropdown Properties: Items: =Sequence(24, 0) DefaultSelectedItems: =[8]
Separador ":"
分隔符 ":"
- lblSep: Control: Text Properties: Text: =":" Weight: =FontWeight.Bold
- lblSep: Control: Text Properties: Text: =":" Weight: =FontWeight.Bold
Minutos (intervalos de 5)
分钟(5分钟间隔)
- ddHoraM: Control: Dropdown Properties: Items: =[0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55] DefaultSelectedItems: =[0]
undefined- ddHoraM: Control: Dropdown Properties: Items: =[0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55] DefaultSelectedItems: =[0]
undefinedConstruir DateTime desde dropdowns:
通过Dropdown组合DateTime:
DateAdd(
DateAdd(Today(), Value(ddHoraH.Selected.Value), TimeUnit.Hours),
Value(ddHoraM.Selected.Value),
TimeUnit.Minutes
)DateAdd(
DateAdd(Today(), Value(ddHoraH.Selected.Value), TimeUnit.Hours),
Value(ddHoraM.Selected.Value),
TimeUnit.Minutes
)Calcular duración:
计算时长:
With(
{
mins: (Value(ddFinH.Selected.Value) * 60 + Value(ddFinM.Selected.Value)) -
(Value(ddInicioH.Selected.Value) * 60 + Value(ddInicioM.Selected.Value))
},
If(mins > 0, Text(RoundDown(mins / 60, 0)) & "h " & Text(Mod(mins, 60)) & "min", "⚠️ Error")
)With(
{
mins: (Value(ddFinH.Selected.Value) * 60 + Value(ddFinM.Selected.Value)) -
(Value(ddInicioH.Selected.Value) * 60 + Value(ddInicioM.Selected.Value))
},
If(mins > 0, Text(RoundDown(mins / 60, 0)) & "h " & Text(Mod(mins, 60)) & "min", "⚠️ 错误")
)📋 Proceso de Paste Code
📋 粘贴代码流程
- Crear la pantalla manualmente en Power Apps Studio
- Asegurar que el nombre coincide con el definido en el YAML
- Copiar TODO el contenido del archivo YAML (incluyendo )
Screens: - Seleccionar la pantalla en el Tree View
- Pegar con Ctrl+V o Click derecho → Paste code
- Si hay errores de design-time por colecciones en , ejecutar (Play ▶️) para que se creen
OnVisible
- 手动创建屏幕:在Power Apps Studio中创建目标屏幕
- 匹配名称:确保屏幕名称与YAML中定义的完全一致
- 复制全部内容:复制YAML文件的所有内容(包括)
Screens: - 选择屏幕:在Tree View中选中目标屏幕
- 粘贴代码:使用Ctrl+V或右键菜单→粘贴代码
- 处理集合错误:若因中的集合导致设计时错误,运行(播放▶️)应用以创建集合
OnVisible
⚠️ Tabla de errores comunes
⚠️ 常见错误对照表
| Error | Causa | Solución |
|---|---|---|
| Propiedad clásica | Usar |
| Propiedad clásica | Usar |
| Propiedad clásica | Usar |
| Propiedad clásica | Usar |
| Propiedad clásica | Usar |
| No soportado | Button overlay transparente |
| Falta Variant | Agregar |
| Variant inválido | Usar |
| Estructura incorrecta | Usar |
| Gallery con ❌ en controles | Colección sin esquema inferible | Usar |
| Nombre duplicado en ranking | GroupBy por columna variable | No agrupar por campos que cambian |
| Comillas en GroupBy | Quitar comillas: |
| 错误信息 | 原因 | 解决方案 |
|---|---|---|
| 使用传统属性 | 改用 |
| 使用传统属性 | 改用 |
| 使用传统属性 | 改用 |
| 使用传统属性 | 改用 |
| 使用传统属性 | 改用 |
| 控件不支持该属性 | 添加透明Button覆盖层 |
| 缺失Variant属性 | 添加 |
| Variant无效 | 使用 |
| 结构错误 | 以 |
| Gallery控件内显示❌ | 集合无可用推断Schema | 使用 |
| 排名中出现重复名称 | 按可变列分组 | 请勿按可修改字段分组 |
| GroupBy中列名加了引号 | 移除引号: |
🧩 Mapeo rápido: Clásico → Moderno
🧩 快速映射:传统→现代
| Control | Propiedad Clásica | Propiedad Moderna |
|---|---|---|
| Text | | |
| Text | | |
| Button | | |
| Button | | |
| Button | | |
| TextInput | | |
| TextInput | | (no existe) |
| DatePicker | | |
| GroupContainer | | (no existe) |
| Todos | | (no existe) |
| 控件 | 传统属性 | 现代属性 |
|---|---|---|
| Text | | |
| Text | | |
| Button | | |
| Button | | |
| Button | | |
| TextInput | | |
| TextInput | | (无此属性) |
| DatePicker | | |
| GroupContainer | | (无此属性) |
| 所有控件 | | (无此属性) |
💡 Tips Power Fx
💡 Power Fx技巧
- Separadores: Usar comas () como separadores — la config regional del entorno define si Power Apps espera
,o,; - Strings multilínea: Usar en YAML seguido de la fórmula con
|-al inicio= - SharePoint Choice columns: Al hacer Patch, usar para columnas de tipo Choice
{Value: "texto"} - SharePoint list names: Verificar el nombre EXACTO de la lista (con números si hay duplicados, ej: )
MiLista1 - Colecciones tipadas: Siempre usar en vez de
ForAll({campo: valor})para colecciones que alimentan GalleryAddColumns - Variables globales: Cachear datos compartidos en y reutilizar en otras pantallas
Screen_Inicio.OnVisible
- 分隔符:使用逗号()作为分隔符 — 环境区域设置决定Power Apps是否接受
,或,; - 多行字符串:在YAML中使用,后续公式以
|-开头= - SharePoint选项列:执行Patch时,选项列需使用格式
{Value: "文本"} - SharePoint列表名称:确认列表的准确名称(若有重复会带数字,例如)
MiLista1 - 强类型集合:为Gallery提供数据时,始终使用而非
ForAll({campo: valor})AddColumns - 全局变量:在中缓存共享数据,在其他屏幕复用
Screen_Inicio.OnVisible