cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Dual Super User III
Dual Super User III

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.

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 III
Dual Super User III

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.

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 III
Dual Super User III

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

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (88,600)