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

Patch SharePoint lists "RANDOMLY" not working

Hi all, 

I am experiencing a weird issue here. I use patch function to pach multiple recordes on a sharepoint list. 

the code is as follows :

Refresh(Comptoir);; (first I refresh the list to avoild any conflicts , because several users use the app to to patch the liste)
ForAll(
Basket_5.AllItems;
Patch(
Comptoir;
Defaults(Comptoir);
{
Produit: Produit;
CP: Entree_identifiant.Text;
NOM: Recup_Nom.Text;
PRENOM: Recup_Prénom.Text;
Campus: Dropdown1.Selected.Value;
Commentaires: Entrée_Commentaires.Text;
CP_Campus: CP_hors_campus.Text;
Quantitee_Enregistree: Quant_2.Selected.Value
}
)
);;

 

While there is nothing wrong with  the code, and the apps works perfectly 90% of the time. Sometimes ( randomly) some request does not go through and the list is not patched, without showing any error message. I though maybe there are some conflicts with multiple users editing the same list, but sometimes even when there is only a single user on the app the patch does not work. 

 

Have you ever experienced a similar issue ? If so, how can I solve it ? 

 

 

 

 

5 REPLIES 5
Highlighted
Dual Super User
Dual Super User

Re: Patch SharePoint lists "RANDOMLY" not working

Are any of the fields in the list marked as requiring a unique value? Since you are using defaults() you will always be creating new records.  If you try to create a new record with a key field that already exists it will fail and I'm not sure the error will come thorugh in a ForAll().



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Frequent Visitor

Re: Patch SharePoint lists "RANDOMLY" not working

Hi, thanks for the reply. No, none of the fields is marked as unique value. Creating new record is my attention from the begining with the patch function. 

 

What is weird also is the patch sometimes takes 3 to 5mn to show the new records in list ( which is not that big, mairly 1500 records). And I don't think I reached the API request thershold. 

 

Still a headack for me since I have no clue why this is happining, especially that it is random. 

Highlighted
Dual Super User
Dual Super User

Re: Patch SharePoint lists "RANDOMLY" not working

Its not abnormal for large batch operations like this to take 3-5 minutes to finalize.  There really is no way to change that for Batch inputs like ForAll



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Frequent Visitor

Re: Patch SharePoint lists "RANDOMLY" not working

Sometimes the patch goes instatnly and sometimes it can take up to 10mn. Still I think it is too much for 3 records with a max of 7 columns of one one in each. Do you think if I move to SQL database instead of Sharepoint lists this issue will desappear ? 

Highlighted
Dual Super User
Dual Super User

Re: Patch SharePoint lists "RANDOMLY" not working

I don't think that its SharePoint doing the delay so I don't think moving to SQL will help.  Leveraging Flow to do the updates might help.  ForAll isn't quite the same thing as a Loop.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (13,108)