Hi all!
I have a strange (for me) behavior of the Save button when I try to save data to the Entity.
In my solution I have following Entities:
1) Modules (just a list on Modules)
2) Aspects (in each Module there are several aspects, judges shoud put Points for aspects for students)
3) Score (Entity for saving Poins for each Aspect for each Student)
In my solution I have a Gallery for choosing Modul. After choosing module you can see Aspects from this Modul. And you can put Points (Stars) for each Aspect in this Modul.
Also I have a Button "Save".
There are examples (screenshots):


The code for the button "Save":
ForAll(
Aspects_Gallery.AllItems,
Collect(
Score_Collect_data,
{
A:Aspect_Label.Text,
B:Type_Label.Text,
C:MaxPoint_Label.Text,
D:Rating1.Value
}
)
);
ForAll(
Score_Collect_data,
Patch(
Score_demo,
Defaults(Score_demo),
{
Score: "new",
Aspect_score: LookUp(Aspects_demo, Aspect=A),
Type_score: B,
Max_score: Value(C),
Score_Number: Value(D),
Expert_score: LookUp(Experts_demo, Experts_demo=Expert_request_Dropdown.Selected.Experts_demo),
Member_score: LookUp(Members_demo, Members_demo=Member_Dropdown.Selected.Members_demo),
Prof_score: LookUp(Prof_demo, Prof_demo=Prof_request_Dropdown.Selected.Prof_demo),
Modul_score: LookUp(Modules_demo, Modules_demo=ProfModules_Gallery.Selected.Modul.Modules_demo)
}
)
);
Patch(
'Modul-Expert-Member_demo',
Defaults('Modul-Expert-Member_demo'),
{Name: Concatenate(ProfModules_Gallery.Selected.Modul.Modules_demo, " - ", Expert_request_Dropdown.Selected.Expert, " - ", Member_Dropdown.Selected.Member)}
)
I expect the following user experience:
1) choose Modul
2) put stars for Module's Aspects
3) press Save button for saving Points to the Entity
4) choose second Module
5) put stars for the next module's Aspect
6) press Save button for saving Points for the second Module's Aspects
etc.
For 1-5 all works well. But when user press Save button for saving Points for second Module's Aspects I get a strange behavior: I got duplicate rows for first module's aspect. If I choose third Module and try to press Save button - I get again duplicate rows for 1st Module and for 2nd and etc.
Could you please help me to find the sollution how to save Points just for Aspects that I see now in the Aspect's Gallery?
Thanks!