Hello Community, hoping you guys can help I've been losing sleep over this!
In my canvas app I am trying to update a connected on-premise SQL table by selecting items in a BrowseGallery1 where CheckBox1.Value = true. This is a screenshot of my initial screen where i select the checkboxes:
BrowseScreen1
My BrowseScreen1 gallery is connected to my SQL db like this:
Filter(SortByColumns(Search('[dbo].[Packing_List_Header]',TextSearchBox1.Text,"User_Text3","Customer_Code","Customer_Name"),"Packing_List_Number",If(SortDescending1,Ascending,Descending)),Company_Code="bhurjeeindsq")
My next button goes to the next screen if something is selected:
If(Checkbox1.Value = true,Navigate(SignatureScreen1))
SignatureScreen1
On SignatureScreen1 we have a datatable to show what records will be updated and a button to submit and call the ForAll function:
ForAll(Filter(BrowseGallery1.AllItems,Checkbox1.Value= true ),Patch('[dbo].[Packing_List_Header]',LookUp('[dbo].[Packing_List_Header]',Packing_List_Header_ID=BrowseGallery1.Selected.Packing_List_Header_ID),{Picked_Up:Toggle1.Value,Pick_Up_Date:Now(),User_Text3:TextInputWaybill.Text}))
As you can see I am trying to update 3 columns in '[dbo].[Packing_List_Header]':
{
Picked_Up: Toggle1.Value,
Pick_Up_Date: Now(),
User_Text3: TextInputWaybill.Text
}
But of all the things I've tried, at best, I can only update 1 record. I've even tried using First(Filter(... but again only 1 row gets updated.
What, pray tell, am i doing wrong?