Hello guys,
I try to store Items in sharepoint list, or update them. (See picture)

Now I have the problem, with the following code
Patch(
Abteilungen,
First(Filter(Abteilungen,Title)),
{
'Anzahl Mitarbeiter':Value(Abt_Mit.Text)
}
);
I only update I should update the amount of Employees. (Which isn't working but that's not the point)
But I cant create new items in that list with that code, therefor that code would work
Patch(
Abteilungen,
Defaults(Abteilungen),
{
Title: Abteilung.Text,
'Anzahl Mitarbeiter':Value(Abt_Mit.Text)
}
);
But this doesn't allow updating one of them, just make duplicates.
I thought about some solutions but can't get them into power apps code.
In words would be like:
If (Abteilungen.Text equals one title in the sharepoint list )
-> {update this entry}
else
-> {create new}
But how can i get this working.