web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / ClearCollect from Shar...
Power Apps
Unanswered

ClearCollect from Sharepoint fail

(0) ShareShare
ReportReport
Posted on by 380
Hello everybody
 
I have an APP working for sometime now but it has started to fail due to increasing data. This situation has brought to analize and make some formulas more efficient, and I came across an issue.
 
I am clearcollecting from a Sharepoint list and most columns I have no problem with, except for the calculated ones.
 
In my SP, data shows like this
When I collect it
When I built the app a few years ago, I solved this by creating a new collection from the initial one, patching the value.
ForAll(
    colBaseIntermedia As _ColIntermedia;
    Patch(
        colBaseNueva;
        LookUp(
            colBaseNueva;
            Title = _ColIntermedia.Title
        );
        {
            Cantidad_x0020_Total: Value(
                Substitute(
                    _ColIntermedia.Cantidad_x0020_Total;
                    ".";
                    ","
                )
            );
            CantidadContada: Value(
                Substitute(
                    _ColIntermedia.CantidadContada;
                    ".";
                    ","
                )
            )
        }
    )
)
But, this has become very unefficient and time consuming when using large data sets.
 
So, I have been trying to fix this, but I can't seem to collect the Sharepoint list updating the value without having to patch it one by one.
 
Can you help me? Is there a way to make this value replacement in a more efficient way?
 
Thank so much in advance!!
Categories:
I have the same question (0)
  • Suggested answer
    SaiRT14 Profile Picture
    1,990 Super User 2025 Season 2 on at
    ClearCollect from Sharepoint fail
    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, ".", ","))
            )
        )
    );
     
     
     
     
     
  • WarrenBelz Profile Picture
    152,847 Most Valuable Professional on at
    ClearCollect from Sharepoint fail
    Hi @Fernanda​​​​​​​
    A suggestion to see if this is faster
    Patch(
       colBaseNueva;
       ForAll(
          colBaseIntermedia As _ColIntermedia;      
          With(
             {
                _ID:
                LookUp(
                   colBaseNueva;
                   Title = _ColIntermedia.Title
                ).ID
             };
             {
                ID: _ID;
                Cantidad_x0020_Total: 
                Value(
                   Substitute(
                      _ColIntermedia.Cantidad_x0020_Total;
                      ".";
                      ","
                   )
                );
                CantidadContada: 
                Value(
                   Substitute(
                      _ColIntermedia.CantidadContada;
                      ".";
                      ","
                   )
                )
             }
          )
       )
    )
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard