HI All,
I have an issue where in offline mode my usual patch data is stored in a local collection, the collection is placed into a gallery and i can see whats i need to see in Gallery, however when the sync is completed, when back online, it sends the correct amount of rows but they are first entry on the list.
the code when submit is below which i believe works
If(
Connection.Connected, // Check if there's an internet connection
Patch(
MasterTest,
Defaults(MasterTest),
{
Trailer: ComboBox1_5.Selected.NewFleetList,
Comments: TextInput1_6.Text,
TimeStamp: Now(),
'User ID': TextInput3_5.Text,
Latitude: TextInput4_10.Text,
Longitude: TextInput4_11.Text,
'Empty Yes / No': ListBox1_5.Selected.Choice,
Site: Label13_1.Text
}
),
Collect(
LocalCollection, // Create a local collection
{
Trailer: ComboBox1_5.Selected.NewFleetList,
Comments: TextInput1_6.Text,
TimeStamp: Now(),
'User ID': TextInput3_5.Text,
Latitude: TextInput4_10.Text,
Longitude: TextInput4_11.Text,
'Empty Yes / No': ListBox1_5.Selected.Choice,
Site: Label13_1.Text
}
)
)
Then the code for sync is here
If(Connection.Connected,
ForAll(
Gallery1.AllItems,
Patch(
MasterTest, // Target data source (MasterTest)
Defaults(MasterTest),
{
Trailer: Gallery1.Selected.Trailer,
Comments: Gallery1.Selected.Comments,
TimeStamp: Now(),
'User ID': TextInput3_5.Text,
Latitude: TextInput4_10.Text,
Longitude: TextInput4_11.Text,
'Empty Yes / No': ListBox1_5.Selected.Choice,
Site: Label13_1.Text
}
);
// Debugging statement to notify that the patch is executed for the current item
Notify("Debug: Patch executed for item " & Gallery1.Selected.Trailer, NotificationType.Information)
)
);
Clear(LocalCollection)
Any help really appreciated. if you need more context please ask
Thx