Hello,
Iterating through a large dataset with ForAll and individually patching records is computationally expensive. Power Apps is not optimized for heavy data processing, especially when working with large datasets.
Pls try the following approach:
Use AddColumns Instead of ForAll - ClearCollect(
colBaseNueva,
AddColumns(
colBaseIntermedia,
"Cantidad_x0020_Total",
Value(Substitute(Cantidad_x0020_Total, ".", ",")),
"CantidadContada",
Value(Substitute(CantidadContada, ".", ","))
)
);
If the SharePoint list contains a large number of records, limit the data retrieved to only the fields you need. Use the ShowColumns function to narrow down the dataset. ClearCollect(
colBaseIntermedia,
ShowColumns(
Filter(
'YourSharePointList',
SomeFilterCondition // Optional filtering to reduce data load
),
"Title",
"Cantidad_x0020_Total",
"CantidadContada"
)
);
Move the transformation logic (like replacing . with , and converting to numeric values) into a calculated column or Flow in Power Automate.
using delegation-compliant functions like Filter or Search. ClearCollect(
colBaseIntermedia,
Filter(
'YourSharePointList',
Title <> ""
)
);
If your dataset is very large, consider implementing pagination or loading data incrementally to avoid performance issues. ClearCollect(
colBaseIntermedia,
FirstN(
Filter(
'YourSharePointList',
SomeCondition
),
500 // Load in batches of 500
)
);
Enable Concurrent Processing Concurrent(
ClearCollect(
colBaseIntermedia,
'YourSharePointList'
),
ClearCollect(
colBaseNueva,
AddColumns(
colBaseIntermedia,
"Cantidad_x0020_Total",
Value(Substitute(Cantidad_x0020_Total, ".", ",")),
"CantidadContada",
Value(Substitute(CantidadContada, ".", ","))
)
)
);