Loading...
Loading...
Genera código YAML pasteable en Power Apps Studio usando el schema pa.yaml v3. Incluye controles modernos, patrones de caché, Gallery con colecciones, y todas las lecciones aprendidas para vibe codear sin errores. Trigger: Cuando el usuario pida crear pantallas, controles o código para Power Apps en formato YAML.
npx skill4agent add rohbunny01/powerapps-skills powerapps-yamlScreens:
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"Screens:Control: ScreenScreens:Control- NombreControl:==Text: ="Hola"X: =0PA2108: Unknown propertyText| ❌ Clásico (NO usar) | ✅ Moderno (USAR) |
|---|---|
| |
| |
- 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.MiddleButton| ❌ Clásico (NO usar) | ✅ Moderno (USAR) |
|---|---|
| |
| |
| |
| (no existe, usa Fluent theme) |
- 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")'ButtonCanvas.Appearance'.Primary'ButtonCanvas.Appearance'.Secondary'ButtonCanvas.Appearance'.TransparentTextInput| ❌ Clásico (NO usar) | ✅ Moderno (USAR) |
|---|---|
| |
| (no existe en moderno) |
| (no existe en moderno) |
- txtEjemplo:
Control: TextInput
Properties:
X: =0
Y: =0
Width: =200
Height: =44
Value: =""
Mode: =TextMode.MultiLine # OpcionalDatePicker| ❌ Clásico (NO usar) | ✅ Moderno (USAR) |
|---|---|
| |
- dpEjemplo:
Control: DatePicker
Properties:
X: =0
Y: =0
Width: =200
Height: =44
SelectedDate: =Today()Dropdown- 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)Items: =Sequence(24, 0) # 0 a 23
Items: =[0, 5, 10, 15, 20, 25, 30] # Lista explícitaGroupContainer| ❌ NO soportado | ✅ Alternativa |
|---|---|
| Usar un Button overlay transparente dentro del container |
| (no existe en modernos) |
- containerEjemplo:
Control: GroupContainer
Variant: ManualLayout
Properties:
X: =0
Y: =0
Width: =200
Height: =100
Fill: =Surface
DropShadow: =DropShadow.LightChildren:
- 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)- galEjemplo:
Control: Gallery
Variant: BrowseLayout_Flexible_SocialFeed_ver5.0 # OBLIGATORIOPA1011: The keyword 'Variant' is required but is missing or emptyItems: =MiListaSPItemsGroupBy + AddColumnsForAll{campo: valor}OnVisible: |-
=ClearCollect(
colRanking,
ForAll(
GroupBy(colRegistros, Title, Email, Registros),
{
Nombre: ThisRecord.Title,
EmailUsuario: ThisRecord.Email,
Puntos: Sum(Registros, Puntos),
Sesiones: CountRows(Registros)
}
)
)# ❌ MAL — "Registros" se interpreta como texto
GroupBy(tabla, "Title", "Email", "Registros")
# ✅ BIEN — identificadores sin comillas
GroupBy(tabla, Title, Email, Registros)EquipoEquipoUsuario: Last(Registros).Equipo# ❌ MAL — ThisRecord.Registros no resuelve
Sum(ThisRecord.Registros, Puntos)
# ✅ BIEN — acceso directo a la columna de grupo
Sum(Registros, Puntos)- 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# Screen_Inicio.OnVisible — carga datos UNA VEZ
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))# Screen_Ranking — usa colRegistrosMes, NO re-consulta SharePoint
OnVisible: |-
=ClearCollect(
colRanking,
ForAll(
GroupBy(colRegistrosMes, Title, Email, Registros),
{ Nombre: ThisRecord.Title, Puntos: Sum(Registros, Puntos) }
)
)
# Screen_Equipos — usa varMiEquipo ya cacheado
OnVisible: |-
=Set(varVistaEquipos, "Lista")
# varMiEquipo ya está cargado desde Screen_Inicio# En btnGuardar.OnSelect, después del Patch:
Patch(MiListaSP, Defaults(MiListaSP), { ... });
Collect(colRegistrosMes, { ...mismo registro... });
Navigate(Screen_Inicio, ScreenTransition.None)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);DatePicker# Horas (0-23)
- ddHoraH:
Control: Dropdown
Properties:
Items: =Sequence(24, 0)
DefaultSelectedItems: =[8]
# Separador ":"
- lblSep:
Control: Text
Properties:
Text: =":"
Weight: =FontWeight.Bold
# Minutos (intervalos de 5)
- ddHoraM:
Control: Dropdown
Properties:
Items: =[0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55]
DefaultSelectedItems: =[0]DateAdd(
DateAdd(Today(), Value(ddHoraH.Selected.Value), TimeUnit.Hours),
Value(ddHoraM.Selected.Value),
TimeUnit.Minutes
)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")
)Screens:OnVisible| 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: |
| Control | Propiedad Clásica | Propiedad Moderna |
|---|---|---|
| Text | | |
| Text | | |
| Button | | |
| Button | | |
| Button | | |
| TextInput | | |
| TextInput | | (no existe) |
| DatePicker | | |
| GroupContainer | | (no existe) |
| Todos | | (no existe) |
,,;|-={Value: "texto"}MiLista1ForAll({campo: valor})AddColumnsScreen_Inicio.OnVisible