Hai Everyone,
I had completed this project apart from update functionality is not working properly. Before it worked fine but now it's is wrongly updating if i edit multiple record also finally patch is updating for only one id.
My requirement is i have a one combo box in that combo box multiple store name is added from connecting another sharepoint list. and i have a date picker so, i can select any date for any one store.
Below that i am using a one gallery with add button
for that i am using one radio button and two textinput to add or update the record into a collection. after editing in gallery i am using a submit button to save in sharepoint list i will attach the every formula i am using. For New records it's working properly the problem is if edit mulitiple records means it's not working it is working for one item and it's is creating a dulicate records
I will attach the screenshot related to that. Please help out .client is pushing everyday
This is how my screen look like.
Code for Edit Icon in Gallery.

For Delete code in gallery .

For Radio button Defaults code
If(varNewEdit,Gallery1_36.Selected.Item_Type)
For Text input Defaults code
If(varNewEdit,varDetails.Customer_Name,"")
For Add button Code
If(
varNewEdit,
Patch(
colStoreLineDetail,
Gallery1_36.Selected,
{
Customer_Name: TextInput1_85.Text,
Deposit_Amount: Value(TextInput1_86.Text),
Item_Type: Radio1_8.Selected.Value,
Store_Email: User().Email,
Store: ComboBox1_21.Selected.STORE_STOREId,
Date: DatePicker1_10.SelectedDate,
ItemType: If(
IsBlank(Gallery1_36.Selected.ID),
"New",
"Edited"
)
}
),
Collect(
colStoreLineDetail,
{
Customer_Name: TextInput1_85.Text,
Deposit_Amount: Value(TextInput1_86.Text),
Item_Type: Radio1_8.Selected.Value,
Store_Email: User().Email,
Store: ComboBox1_21.Selected.STORE_STOREId,
Date: DatePicker1_10.SelectedDate,
ItemType: "New"
}
)
);
UpdateContext({varNewEdit: false});
Reset(Radio1_8);
Reset(TextInput1_85);
Reset(TextInput1_86);
Finally on Save button
ForAll(
Filter(
colStoreLineDetail,
ItemType = "New"
),
Patch(
Dev_DSR_Line_Details,
Defaults(Dev_DSR_Line_Details),
{
Customer_Name: ThisRecord.Customer_Name,
Deposit_Amount: ThisRecord.Deposit_Amount,
Store_Email: User().Email,
Item_Type: ThisRecord.Item_Type,
Date: DatePicker1_10.SelectedDate,
Store: ComboBox1_21.Selected.STORE_STOREId
}
)
);
ForAll(
Filter(
colStoreLineDetail,
ItemType = "Edited"
),
Patch(
Dev_DSR_Line_Details,
LookUp(
Dev_DSR_Line_Details,
ID = Gallery1_36.Selected.ID
),
{
Customer_Name: ThisRecord.Customer_Name,
Deposit_Amount: ThisRecord.Deposit_Amount,
Store_Email: User().Email,
Item_Type: ThisRecord.Item_Type,
Date: DatePicker1_10.SelectedDate,
Store: ComboBox1_21.Selected.STORE_STOREId
}
)
);
ForAll(
Filter(
colStoreLineDetail,
ItemType = "Deleted"
),
Remove(
Dev_DSR_Line_Details,
ThisRecord
)
);
Clear(colStoreLineDetail)
On change of Combo box formula.
UpdateContext({varNewEdit: false});
ClearCollect(
colStoreLineDetail,
AddColumns(
Filter(
Dev_DSR_Line_Details,
Store = Self.Selected.STORE_STOREId && Date = DatePicker1_10.SelectedDate
),
"ItemType",
"ToEdit"
)
)
Thanks in advance.