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.
Patch(ThisItem, First( Filter(Book, BrowseGallery1.Selected.ID = ThisRecord.IDAnagrafica.Id)), { ID_User: ""HERE WHAT I NEED TO SET""} )
Thx for help