Power Apps中使用单选组合框修补Person列时出现架构错误求助
错误原因
你手动构造的Person记录与SharePoint期望的Record schema不匹配,尽管你写了Department: "",但系统识别不到符合要求的Text类型字段(大概率是空字符串与Blank类型的差异导致)。
解决方案1:直接使用组合框选中的用户记录(推荐)
如果按钮操作基于组合框选择的用户,无需手动构造Person记录,直接引用组合框选中项即可——Office365Users返回的用户对象与SharePoint Person列的schema天然兼容:
Patch( evListDriverLicence, Defaults(evListDriverLicence), { Driver: ComboBox1.Selected // 替换为你的组合框控件名称 } );
解决方案2:手动构造符合要求的Person记录
如果必须手动指定用户,需确保字段类型严格匹配,将Department的空字符串改为Blank():
Patch( evListDriverLicence, Defaults(evListDriverLicence), { Driver: { '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims: "i:0#.f|membership|Anji.Jella@orikan.com", Department: Blank(), DisplayName: "Anji Jella", Email: "Anji.Jella@orikan.com", JobTitle: Blank(), Picture: Blank() } } );
解决方案3:通过Office365Users API获取用户记录后Patch
先调用API获取完整用户信息,再基于该信息构造符合要求的Person对象,彻底避免schema不匹配问题:
// 先获取目标用户的完整信息 Set(varTargetUser, Office365Users.GetUserV2("Anji.Jella@orikan.com")); // 执行Patch操作 Patch( evListDriverLicence, Defaults(evListDriverLicence), { Driver: { '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims: "i:0#.f|membership|" & varTargetUser.UserPrincipalName, Department: varTargetUser.Department, DisplayName: varTargetUser.DisplayName, Email: varTargetUser.Mail, JobTitle: varTargetUser.JobTitle, Picture: "" } } );
内容的提问来源于stack exchange,提问作者HKAK
相关产品推荐
相关产品推荐

