I assume this is a super-common use case for PowerApps so surely there must be a solution to my problem but I just can't figure out how to do it.
Im working on a PowerApp which lets users bulk-edit Opportunity Lines that are assigned to an Opportunity. As a first step, I create a local collection of the required records
ClearCollect(
colOppLines,
Filter(
'Opportunity Lines',
Opportunity.Opportunity = varOpportunity.Opportunity
)
);
This creates a local collection of 500-1,000 records from the Opportunity Lines table. Then as a second step, I have users modify 4-5 fields on the collection using a gallery. As a final step, I am patching the CE table using the updated collection.
There are three methods I looked at on how to do this:
Method 1
Patch('Opportunity Lines', colOppLines)
This method doesnt work because it will attempt to patch all fields on the CE table. Since CE tables always have several fields that can't be modified, it results in the error "Network error when using Patch function: The specified column is read-only and can't be modified".
Method 2
ForAll(
colOppLines,
Patch(
'Opportunity Lines',
ThisRecord,
{
'Service Account': ThisRecord.comboboxSite.Selected,
'Equipment Type': ThisRecord.dropdownEqType.Selected,
'Equipment Size': ThisRecord.dropdownEqSize.Selected,
'Equipment Owner': ThisRecord.dropdownEqOwner.Selected
}
)
)
This method works, but takes an excessive amount of time and potentially crashes the PowerApp because it will execute the Patch function once for each record in the collection (which can contain up to 1,000 records).
Method 3: triggering a Power Automate flow but this similarly will take quite some time since I believe you would still have to update each record individually? Probably will be more efficient than method 2 though.
I'm hoping anyone else here has found a way to bulk-edit CE records in PowerApps? I'm aware of out-of-the-box ways to do it in CE but there's several other reasons why we specifically want to utilize PowerApps.