[英]Update ForeignKey Sharepoint List using onSelect button with Patch() - PowerApps
My problem is what I describe in the title.我的问题是我在标题中所描述的。 I want to update a foreign key on my sharepoint list with a button.
我想用一个按钮更新我的共享点列表上的外键。
I have two List with OneToMany relation:我有两个单对多关系列表:
User{ ID, Name, Surname}
Book{ID, Title, Author, ID_User}
When I go one user, with a gallery, i can see the book related with a Filter:当我去一个用户的画廊时,我可以看到与过滤器相关的书:
Filter(Book,BrowseGallery1.Selected.ID = ThisRecord.IDUser.Id)
In this gallery i want to add a Trash and when i click the button remove the Book of this User, soo i want to remove the relation and see only the book related with this user.在这个库中,我想添加一个垃圾箱,当我单击按钮删除此用户的书时,我想删除关系并仅查看与此用户相关的书。
I try with:我尝试:
Patch(ThisItem, First( Filter(Book, BrowseGallery1.Selected.ID = ThisRecord.IDAnagrafica.Id)), { ID_User: 0} )
But give me an error.但是给我一个错误。 I try this patch with other columns like {Title: "TEST"} and it work.
我将这个补丁与其他列(如 {Title: "TEST"} 一起尝试)并且它有效。
Patch(ThisItem, First( Filter(Book, BrowseGallery1.Selected.ID = ThisRecord.IDAnagrafica.Id)), { ID_User: ""HERE WHAT I NEED TO SET""} )
Thx for help谢谢帮助
{ID_User: Value("Your value")} {ID_User: Value("你的价值")}
https://powerusers.microsoft.com/t5/Building-Power-Apps/Patch-SharePoint-List-Number-Column/td-p/102371 https://powerusers.microsoft.com/t5/Building-Power-Apps/Patch-SharePoint-List-Number-Column/td-p/102371
EDIT编辑
Look at this answer看看这个答案
https://powerusers.microsoft.com/t5/Building-Power-Apps/The-type-of-this-argument-X-does-not-match-the-expected-Type/td-p/599727 https://powerusers.microsoft.com/t5/Building-Power-Apps/The-type-of-this-argument-X-does-not-match-the-expected-Type/td-p/599727
from this由此
{ ID_User: 0}
to this对此
{ ID_User: {Value:"YOUR ID OR TEXT"} }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.