You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PowerApps OnSuccess多Patch函数语法报错求助(分号错误)

PowerApps代码报错修复方案

报错原因及修正点:

  1. 拼写错误:Defaults(workhop_booked)中的workhop拼写错误,应为workshop_booked,系统无法识别错误拼写的数据源会触发语法报错。
  2. 多余分号:ChildNumber: "";末尾多了一个分号,PowerApps对象属性列表中,最后一个属性后不能添加分隔符(无论用分号还是逗号)。
  3. 冗余写法优化:swisscomLocationsId: (1);中的括号属于不必要写法,可改为swisscomLocationsId: 1;,不影响功能但代码更规范。

修正后的完整代码:

Patch(
    workshop;
    Defaults(workshop);
    {
        Titel: DataCardValue1.Text;
        room: DataCardValue2.Text;
        description: DataCardValue3.Text;
        start: Text(HourInputStart.Value) & Text(MinuteInputStart.Value);
        end: Text(HourInputEnd.Value) & Text(MinuteInputEnd.Value);          
        language: DropdownLanguage.Selected.Value;    
        capacity: CapacityInput.Value;
        employeeId: Text(User().EntraObjectId);
        swisscomLocationsId: 1;      
        teamsMeeting: DataCardValue11.Text  
    }
);


ForAll(
    Sequence(CapacityInput.Value);
    Patch(
        workshop_booked;
        Defaults(workshop_booked);
        {
            Titel: "Irrelevant";
            WorkshopID: "12";
            WorkshopCreator: Text(User().EntraObjectId);
            ChildName: "";
            ChildNumber: ""
        }
    )
)

内容的提问来源于stack exchange,提问作者user23469609

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 01:03:16