Hey, Not having an issue posting from the App to SQL, the issue is that if i have 3 items in the collection it's pasting 3 items in SQL table, but all as the last entry in the Collection. The Collection is grabbing all the data from a Gallery and apending it correct in the app, but when submitted its just the wrong data.
This is the code from the Gallery + add new:
Patch(
SampleCollection,
ThisItem,
{
SampleQtyCol: Value(Qty.Text),
SampleQtyDescCol: QtyDesc.Text,
SampleDateCol: Date.SelectedDate,
SampleTypeCol: Type.Text,
SampleTestCol: Test.Text,
SampleReceivedCol: Received.Value
}
);
Collect(
SampleCollection,
{
SampleQtyCol: 0,
SampleQtyDescCol: "",
SampleDateCol: Today(),
SampleTypeCol: "",
SampleTestCol: "",
SampleReceivedCol: false
}
)This is the code from OnSuccess.
ForAll(
SampleCollection,
If(
!IsBlank(Qty),
Patch(
'[dbo].[SampleData]',
Defaults('[dbo].[SampleData]'),
{
SampleDate: Date.SelectedDate,
SampleQty: Value(Qty.Text),
SampleQtyDesc: QtyDesc.Text,
SampleType: Type.Text,
SampleTest: Test.Text,
SampleRecevied: Received.Value,
SSFMaster: Form2.LastSubmit.SSFID
}
)
)
)I have attached the SQL Screenshoot.
Any help would be appreciated