如何获取正确的记录模式以通过 Powerapps 中的补丁功能发送用户

How to get the correct record schema for sending a user through a Patch function in Powerapps

我正在尝试使用 powerapps 中的补丁功能将用户发送到 Sharepoint 列表。

我已经尝试按照将其包含在我的补丁中的方式做一些事情:

{  
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",  
DisplayName:User().FullName,
Email:User().Email
}

例如我会

    Patch('Issue Tracker', Defaults('Issue Tracker'),{
        'Project Name':ProjectName,'Occurred at Timestamp': DateTimeValue(DateTimeString)- (14/24), 'Reported By':     {  
        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",  
        DisplayName:User().FullName,
        Email:User().Email
        }
}

我从中得到的错误是我的用户记录中缺少一列,我需要一个名为“Claim”的列,并且它是文本类型。

我在 User() 函数的智能感知中找不到对 Claim 的任何引用,在 Office365Users.MyProfile() 函数中也找不到对 Claim 的任何引用,所以我不能只说该字段的“User().Claim”(例如)。

因此,如果我仅通过说 'Claim: ""' 添加索赔列并继续,我会收到一个错误,因为缺少名为“JobTitle”等的列

所以最终我的记录是这样的:

{  
    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",  
    DisplayName:User().FullName,
    Email:User().Email,
    Claims: "",
    Department: Office365Users.MyProfile().Department,
    JobTitle:Office365Users.MyProfile().JobTitle,
    Picture:User().Image
    }

在此之后,我得到的错误是找不到用户。

我不知道索赔要写什么,我不知道如何获得正确的信息。 我想保留报告问题的人的日志,而不需要他们自己从组合框或下拉列表中手动 select。

有人可以帮忙吗?

SharePoint 中个人记录的 'Claims' 属性 没有非常 user-friendly 的格式。它应该类似于

"i:0#.f|membership|" & User().Email

要确定您的 SharePoint 列表中的预期值/格式,您可以在您的应用中添加一个标签,列出其中一位用户的 属性:

First('Issue Tracker').'Reported By'.Claims

您可以在博客 post https://powerapps.microsoft.com/blog/default-values-for-complex-sharepoint-types/ 上找到有关将 Person 对象发送到 SharePoint 的更多信息。