微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在电源应用程序中实现类似按钮

如何解决在电源应用程序中实现类似按钮

我正在尝试在 Microsoft 电源应用程序中实现类似功能。我在按赞按钮时遇到问题我收到错误

The type of this argument "LikedBy" does not match the expected type "Record" found type "text" instead. 

我使用的代码

Patch(
ProposalLikes,Defaults(ProposalLikes),{   
    ThemeID: ThisItem.ID,Liked: 1,LikedBy: User().Email
}

)

我的结构数据列表看起来像

IMage

有人知道我为什么会收到这个错误吗?

解决方法

看起来 LikedBy 是 Sharepoint 列表中的个人类型列。如果是,则它是 Record 数据类型,而 User().EmailText 数据类型。使用 User() 来修补 Person 类型的列可能很诱人,但架构不匹配。

个人类型的列架构(Sharepoint)

{         
  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",Claims:"i:0#.f|membership|user@user.com",Department:"",DisplayName:"",Email:"",JobTitle:"",Picture:""
}

要修补人员类型的列,试试这个:

Patch(
    ProposalLikes,Defaults(ProposalLikes),{   
        ThemeID: ThisItem.ID,Liked: 1,LikedBy: 
        {
          '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",Claims:"i:0#.f|membership|" & User().Email,DisplayName:User().FullName,Email:User().Email,Picture:""
        }
    }
)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。