cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Incorrect Register of Patch with ForAll Function

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Incorrect Register of Patch with ForAll Function

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Dual Super User II
Dual Super User II

Re: Incorrect Register of Patch with ForAll Function

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

Highlighted
Community Support
Community Support

Re: Incorrect Register of Patch with ForAll Function

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Incorrect Register of Patch with ForAll Function

@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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,891)