Hi,
I built a staff appraisal app the saves from a collection to a SharePoint list, around 60 lines per user, the app collects the entries on start then the user can make changes to previously submitted ratings or add new ones.
the save button will patch all 60 lines from the collection back to SP but is currently very slow, I was wondering if anyone knows if there is a way to customize the code below to save faster.
Set(LoadingSpinnerVisibility,true);
ForAll(RenameColumns(CollectionUserGrids, "ID", "CID","SelfAppraisal", "CSelfAppraisal", "FinalResponses", "CFinalResponses","IsTarget", "CIsTarget"), Patch('Appraisal Data Details', LookUp('Appraisal Data Details', ID = CID), {SelfAppraisal: CSelfAppraisal}, {FinalResponses: CFinalResponses},{IsTarget: CIsTarget}));
Set(LoadingSpinnerVisibility,false)
Many thanks in advance.
Nelly
Hi @NGamil ,
It's hard to optimize the ForAll function itself, but we can get goal in roundabout way.
As @poweractivate said, try to use flow to save collection data to SP list in bulk, the flow just runs in the backend more efficiently.
1. convert collection to JSON in PowerApps
Set(VarJson,JSON(MyCollection,JSONFormat.IncludeBinaryData))
2. parse json in flow
3. apply to each row, and create the items to Sharepoint list.
Sik
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional