Hi @amyharkus86 ,
Create a collection of records that are updated in the gallery.
Note: Your record must have a unique identifier to patch the datasource
Let's say you have 5 fields in your gallery with editable control,
OnChange of those controls, write the code as,
If(
ThisItem.IsSelected,
If(
ThisItem.ID in ColCustomerCare.ID,
Update(
ColCustomerCare,
LookUp(
ColCustomerCare,
ID = ThisItem.ID
),
{
//All fields that can be modified
}
),
Collect(
ColCustomerCare,
{
//All fields that can be modified
}
)
),
Clear(ColCustomerCare)
);
When you click on Save All, patch the collection,
IfError(
ForAll(
ColCustomerCare,
Patch(
CustomerCareList,
LookUp(
CustomerCareList,
ID = ColCustomerCare[@ID]
),
{
//All fields that needs to be updated
}
)
),
Notify("Error in Saving Data",NotificationType.Error, 2000);
false;
,
Notify("Data Saved Successfully", NotificationType.Success, 1000);
Clear(ColCustomerCare);
true;
);
//OR entire collection
IfError(
Patch(
<dataSource - ListSP>,
ColCustomerCare
)
),
Notify("Error in Saving Data",NotificationType.Error, 2000);
false;
,
Notify("Data Saved Successfully", NotificationType.Success, 1000);
Clear(ColCustomerCare);
true;
);
Hope this helps