Hello,
I created a Datasheet with 2 Sections. Both Sections have a Save Button:
Save Button 1:
Collect(OfflineOverviewCollection,
{
Bereich: BereichDropdown.SelectedText.Value,
Unternehmen: UnternehmenInput.Text,
});
SaveData(OfflineOverviewCollection,"Offline")
SaveButton 2 has the entries of the second Section:
Collect(OfflineOverviewCollection,
{
Fahrzeughersteller: FahrzeugherstellerInput.Text,
Fahrzeugtyp: FahrzeugtypDropdown.SelectedText.Value,
Fahrzeugmodell: FahrzeugmodellInput.Text,
});
SaveData(OfflineOverviewCollection,"Offline")
The SaveData is an Offline Function, working with a LoadButton using
LoadData(OfflineOverviewCollection,"Offline")
The Code where i think is the Problem, an Upload Button with a ForAll/Patch Function, to upload it to a SharepointSite:
ForAll(OfflineOverviewCollection,
Patch(OverviewList, Defaults(OverviewList)
,{
Bereich: Concat(OfflineOverviewCollection.Bereich, Bereich),
Unternehmen: Concat(OfflineOverviewCollection.Unternehmen, Unternehmen),
Fahrzeughersteller: Concat(OfflineOverviewCollection.Fahrzeughersteller, Fahrzeughersteller),
Fahrzeugtyp: Concat(OfflineOverviewCollection.Ort, Ort),
Fahrzeugmodell: Concat(OfflineOverviewCollection.Fahrzeugmodell, Fahrzeugmodell),
}
)
)
I tried it out and first i got 2 entries when clicking on Both SaveButtons, then on Load Data and finally on Upload
I clicked on it again and since then im getting 4 entries everytime, just by clicking on Upload
I found an older "Solution" for the same problem, but i dont know how to use the code on my example:
https://powerusers.microsoft.com/t5/Building-Power-Apps/ForAll-is-creating-same-record-multiple-times-on-multi-select/td-p/1439292
Thanks for the Help!
Pascal