@Joorge_c
Get rid of the formula you have in the OnStart, you're not going to need that.
So, for your OnChange:
RemoveIf(crUpdates, id=ThisItem.id);
Collect(crUpdates,
{
id: ThisItem.id,
Renewing_x003f_: 'CR_Renewing?_Drop'.Selected.Value,
Renewal_x0020_Month: CR_RenewalMonth_Drop.Selected.Value,
New_x0020_Contract_x0020_Start_x0020_Date: CR_ContractSDate_Drop.Selected.Value
}
)
This removes the item from the collection if it exists. Then it adds the current record.
For your Submit:
With({_results:
ForAll(crUpdates As _update,
Patch(CurrentR,
Coalesce(LookUp(CurrentR, id=_update.id), Defaults(CurrentR)),
_update
)
);
If(IsEmpty(Errors(CurrentR)),
Notify("Success", NotificationType.Success)
)
);
Clear(crUpdates);
Since you are dealing with updating records, we can't just push them back with the Collect (collect to a datasource will add new records, but it will not update existing). So we do look to our friend the Patch function for this.
This is somewhat along the lines of where you were going. I didn't add the extra error checking in here because you are dealing with Excel and, since I don't work with it a lot as a datasource, I'm not sure that any record by record errors are relevant, but I left the general construct in.
So, we ForAll on the collection and then either create a record or update an existing record (Coalesce helps us with that).
Finally, we just check the errors on the datasource to determine if the notify happens.
Hopefully that will move you to the next step.