我正在尝试在微软的power应用程序中实现like功能。我在按like按钮时遇到问题,我收到错误
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
})
我的结构数据列表看起来像这样

有人知道我为什么会收到这个错误吗?
发布于 2021-07-01 22:02:48
LikedBy似乎是Sharepoint列表中的Person类型的列。如果是,则它是Record数据类型,而User().Email是Text数据类型。使用User()修补Person类型的列很有诱惑力,但是模式并不匹配。
Sharepoint人员类型列架构()
{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|user@user.com",
Department:"",
DisplayName:"",
Email:"",
JobTitle:"",
Picture:""
}要修补Person类型的列,请尝试以下命令:
Patch(
ProposalLikes,
Defaults(ProposalLikes),
{
ThemeID: ThisItem.ID,
Liked: 1,
LikedBy:
{
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims:"i:0#.f|membership|" & User().Email,
Department:"",
DisplayName:User().FullName,
Email:User().Email,
JobTitle:"",
Picture:""
}
}
)https://stackoverflow.com/questions/68171943
复制相似问题