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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Incorrect Register of ...
Power Apps
Answered

Incorrect Register of Patch with ForAll Function

(0) ShareShare
ReportReport
Posted on by 87

Hi,

 

I'm using Sharepoint as a database for my app.

I use ForAll function to create new registers using the references from the list ABC in the Sharepoint. The patching result is saved into list XYZ in the same Sharepoint. The idea is I want the user to use the template from ABC and update information into XYZ list. Here is the example of the formula:

 

ForAll(ABC, Patch(XYZ, Defaults(XYZ), {
 ProjectNameP: ProjectName ,
 SubProjectP: SubProject,
 DG_PhaseP: DG_Phase,
 MainParentPDP: MainParentPD} ) )

The number of rows in the references (ABC) is say to be 550 records. In addition, I extended the delegables default into 1000 in the settings. 

I use this formula a couple of months ago and it works fine. But recently, everytime I patch using the formula above, the number of new records is randomly always below 550, which resulting in incorrect template. 

When I check my edit screen, some of the box in the forms show message "Rate limit exceeded. Please try again in .. seconds".

 

Can someone please help me with the issue. Thanks in advance. 

Categories:
  • RezaDorrani Profile Picture
    12,145 on at

    Hi @HeihoSilver 

     

    Rate limit is because you are probably exceeding the number of calls being made to SharePoint within a defined timeframe

     

    Also, for better performance,

    right before patch try setting the default data source value to a variable

     

    Set(defaultXYZ, Defaults(XYZ));ForAll(ABC, Patch(XYZ, defaultXYZ, {
    ProjectNameP: ProjectName ,
    SubProjectP: SubProject,
    DG_PhaseP: DG_Phase,
    MainParentPDP: MainParentPD} ) )

     

    Regards,

    Reza Dorrani

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @HeihoSilver ,

    The "Rate limit exceeded" error message told that you have exceeded the API call limits with your formula within a defined Period (e.g. 60 seconds).

     

    Please consider modify your formula as below:

    Set the OnStart property of the App control to following:

    ClearCollect(ABCCollection, ABC);
    Set(DefaultRecord, Defaults(XYZ))

    Then modify your formula Patch formula as below:

    ForAll(
    ABCCollection,
    Patch(
    XYZ,
    DefaultRecord,
    { ProjectNameP: ProjectName , SubProjectP: SubProject, DG_PhaseP: DG_Phase, MainParentPDP: MainParentPD
    }
    )
    )

    or

    ForAll(
    ABCCollection,
    Collect(
    XYZ,
    { ProjectNameP: ProjectName , SubProjectP: SubProject, DG_PhaseP: DG_Phase, MainParentPDP: MainParentPD
    }
    )
    )

    Then re-load your app (fire the OnStart property of App), then try above formula again, check if the issue is solved.

    Note: Please also make sure your Network is in a good condition, the Network state would also affect the execution speed of the formula in your app.

     

    Best regards,

  • HeihoSilver Profile Picture
    87 on at

    @RezaDorrani Thank you for your suggestion, but I still found the same problem with your method.

    I think you almost have the same solution as @v-xida-msft which is a solution for my problem.

    With additional "ClearCollect" function it makes data stored temporarily in the PowerApps and make patching process faster. 

    Thank you all both. Cheers

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard