cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Bakrsn
Level: Powered On

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
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.
Bakrsn
Level: Powered On

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. 

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.
Bakrsn
Level: Powered On

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 ? 

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (7,712)