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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error during saving to...
Power Apps
Answered

Error during saving to Sharepoint Lists.

(0) ShareShare
ReportReport
Posted on by 57

Hello

I have an application that uses sharepoint lists.
So far, everything has worked fine.
From that week on, errors started popping up:
An error occurred while saving the changes or and Server's response - List -null.
Can you help me?

My code:

Lista_v15 ->Sharepoint List (4790 records)

LargeList -> Collection

 

Refresh(Lista_v15);;
Patch(LargeList;LookUp(LargeList;Licznik=tmpLicznik);
{RON:kRejon1.Selected;
)});;

SubmitForm(EditForm1);;
Navigate(scr1;ScreenTransition.None);;
Refresh(Lista_v15);;

SortByColumns(LargeList;"Licznik";Descending);;

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @Thoma2008 ,

    You had a couple of extra brackets in there - also try this

    Patch(
     LargeList;
     {LargeList;Licznik=tmpLicznik};
     {RON:kRejon1.Selected}
    );;
    

     I assume here RON is a complex field type.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Thoma2008 Profile Picture
    57 on at

    Yes I know, it is fragment of my code.

    My problem are errors on saving.

    Can you help me?

     

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @Thoma2008 ,

    I would have to see the full code - what I posted should save to the data source.

  • Thoma2008 Profile Picture
    57 on at

    @WarrenBelz 

    At the beginning of the program, I create a collection called LargeList. Here is the code:
    Clear(LargeList);; Clear(iterations);;
    Set(tabNumer;First(ListaLicz).PoleLicz);;
    Set(iterationsNo;RoundUp((tabNumer - 1) / 499;0));;
    Collect(iterations; Sequence(iterationsNo;0));;
    ForAll(iterations;
    With({prevThreshold: Value(Value) * 499;
    nextThreshold: (Value(Value) + 1) * 499
    };
    If(tabNumer > Value;
    Collect(LargeList;Filter(Lista_v15;Licznik>prevThreshold && Licznik <= nextThreshold))
    )
    )
    );;
    On the second screen I have Gallery1 based on the LargeList collection.
    SortByColumns(If(ComboBox2.Selected.Value="Wybierz";Filter(LargeList;((txtSearch1.Text in Nazwisko)||(txtSearch1.Text in Sygnatura)||(txtSearch1.Text in Nr_DRP)||(txtSearch1.Text in Adres)||(txtSearch1.Text in NrFWI)||(txtSearch1.Text in DataDRP)));Filter(LargeList;And((MecenasW in ComboBox2.SelectedItems);(txtSearch1.Text in Nazwisko)||(txtSearch1.Text in Sygnatura)||(txtSearch1.Text in Nr_DRP)||(txtSearch1.Text in Adres)||(txtSearch1.Text in NrFWI)||(txtSearch1.Text in DataDRP))));"Licznik";Descending)

    After pressing the edit button I go to EditScreen1. I edit the data and press the save button.

    In the OnSelect property of this button I have:

    Set(tmpLicznik;Value(tLicznik1.Text));;
    Refresh(Lista_v15);;Refresh(Opinie);;
    Patch(LargeList;LookUp(LargeList;Licznik=tmpLicznik);
    {RON:kRejon1.Selected;
    REWIR:tRewir1.Text;
    MecenasW:kMecenas1.Selected;
    Kancelaria:txtKanc1.Selected;
    Nazwisko:tNazwisko1.Text;
    Adres:tAdres1.Text;
    WlasnoscLokalu:kWlasnosc1.Selected;
    PrzedmiotSporu:kPrzedmiot1.Selected;
    DataDRP:dDRP1.SelectedDate;
    Nr_DRP:tNumerDRP1.Text;
    NrFWI:tNumerwwi1.Text;
    DataPozwu:dDataPoz1.SelectedDate;
    DataOdpowiedzi:dDataOdp1.SelectedDate;
    Sad:kSada1.Selected;
    Sygnatura:tSygnatura1.Text;
    PrzewidywaneKoszty:Value(tPrzewKoszty1.Text);
    WPS:Value(tWPS1.Text);
    OsobaMeryt:DataCardValue37.Selected;
    Wnioskodawca:tWniosk1.Text;
    StanSprawy:tStanS1.Text;
    Rekomendacja:tRekom1.Text;
    TerminSpr:dTerminSpr1.SelectedDate;
    Uwagi:tUwagi1.Text;
    ALARM:dAlarm1.SelectedDate;
    Status:kStatusSpr1.Selected;
    DataZamkniecia:dDataZ1.SelectedDate;
    OstateczneKoszty:Value(tOstatK1.Text);
    SposóbZamk:tSposobZ1.Text;
    Rekomendacjawn:tRekomendacjaW1.Text;
    Dataorzecz:dDataOrz1.SelectedDate;
    Orzeczenie:kOrzecz1.Selected;
    Datapraw:dDataPra1.SelectedDate;
    Klauzula:kKlauzula1.Selected;
    Datawyk:dDataW1.SelectedDate;
    emailM:temail1.Text;
    Kosztysadowe:Value(walKoSa1.Text);
    Kosztypelnomocnika:Value(walKoPel1.Text);
    UwagiObsluga:txtUObsluga1.Text;
    GodzSpr:txtGodzS1.Text;
    Sala:txtSala1.Text;
    KosztyKl:Value(txtKosztyKl1.Text);
    UwagiOrzeczenie:DataCardValue1.Text;
    Naleznoscizas:Value(tNaleznosciZas1.Text)});;


    SubmitForm(EditForm1);;
    Navigate(scrPusty;ScreenTransition.None);;
    Refresh(Lista_v15);;

    SortByColumns(LargeList;"Licznik";Descending);;
    Navigate(StartScreen1; ScreenTransition.Cover)

     

    The following messages appear while saving: An error occurred while saving the changes. It doesn't happen every time, but more and more often.

     

     

     

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @Thoma2008 ,

    Can you please use Format Text on all of that and post in a Text Box (the </> icon above)

    WarrenBelz_1-1648379652314.png

     

    WarrenBelz_0-1648379595932.png

     

    .

  • Thoma2008 Profile Picture
    57 on at

    @WarrenBelz 

    The following messages appear while saving: An error occurred while saving the changes. It doesn't happen every time, but more and more often. That is my problem.

    At the beginning of the program, I create a collection called LargeList. Here is the code:

     

    If(
     UżytkownicyusługiOffice365.MyProfile().Department = "READ";
     Notify("Nie masz uprawnień do tej funkcji");
     Clear(LargeList);;
     Clear(iterations);;
     Set(
     tabNumer;
     First(ListaLicz).PoleLicz
     );;
     Set(
     iterationsNo;
     RoundUp(
     (tabNumer - 1) / 499;
     0
     )
     );;
     Collect(
     iterations;
     Sequence(
     iterationsNo;
     0
     )
     );;
     ForAll(
     iterations;
     With(
     {
     prevThreshold: Value(Value) * 499;
     nextThreshold: (Value(Value) + 1) * 499
     };
     If(
     tabNumer > Value;
     Collect(
     LargeList;
     Filter(
     Lista_v15;
     Licznik > prevThreshold && Licznik <= nextThreshold
     )
     )
     )
     )
     );;
     Navigate(
     StartScreen1;
     ScreenTransition.Cover
     )
    )

     

    On the second screen I have Gallery1 based on the LargeList collection.

     

    SortByColumns(
     If(
     ComboBox2.Selected.Value = "Wybierz";
     Filter(
     LargeList;
     ((txtSearch1.Text in Nazwisko) || (txtSearch1.Text in Sygnatura) || (txtSearch1.Text in Nr_DRP) || (txtSearch1.Text in Adres) || (txtSearch1.Text in NrFWI) || (txtSearch1.Text in DataDRP))
     );
     Filter(
     LargeList;
     And(
     (MecenasW in ComboBox2.SelectedItems);
     (txtSearch1.Text in Nazwisko) || (txtSearch1.Text in Sygnatura) || (txtSearch1.Text in Nr_DRP) || (txtSearch1.Text in Adres) || (txtSearch1.Text in NrFWI) || (txtSearch1.Text in DataDRP)
     )
     )
     );
     "Licznik";
     Descending
    )

     

    After pressing the edit button I go to EditScreen1. I edit the data and press the save button.

     

    Set(
     tmpLicznik;
     Value(tLicznik1.Text)
    );;
    Refresh(Lista_v15);;
    Refresh(Opinie);;
    Patch(
     LargeList;
     LookUp(
     LargeList;
     Licznik = tmpLicznik
     );
     {
     RON: kRejon1.Selected;
     REWIR: tRewir1.Text;
     MecenasW: kMecenas1.Selected;
     Kancelaria: txtKanc1.Selected;
     Nazwisko: tNazwisko1.Text;
     Adres: tAdres1.Text;
     WlasnoscLokalu: kWlasnosc1.Selected;
     PrzedmiotSporu: kPrzedmiot1.Selected;
     DataDRP: dDRP1.SelectedDate;
     Nr_DRP: tNumerDRP1.Text;
     NrFWI: tNumerwwi1.Text;
     DataPozwu: dDataPoz1.SelectedDate;
     DataOdpowiedzi: dDataOdp1.SelectedDate;
     Sad: kSada1.Selected;
     Sygnatura: tSygnatura1.Text;
     PrzewidywaneKoszty: Value(tPrzewKoszty1.Text);
     WPS: Value(tWPS1.Text);
     OsobaMeryt: DataCardValue37.Selected;
     Wnioskodawca: tWniosk1.Text;
     StanSprawy: tStanS1.Text;
     Rekomendacja: tRekom1.Text;
     TerminSpr: dTerminSpr1.SelectedDate;
     Uwagi: tUwagi1.Text;
     ALARM: dAlarm1.SelectedDate;
     Status: kStatusSpr1.Selected;
     DataZamkniecia: dDataZ1.SelectedDate;
     OstateczneKoszty: Value(tOstatK1.Text);
     SposóbZamk: tSposobZ1.Text;
     Rekomendacjawn: tRekomendacjaW1.Text;
     Dataorzecz: dDataOrz1.SelectedDate;
     Orzeczenie: kOrzecz1.Selected;
     Datapraw: dDataPra1.SelectedDate;
     Klauzula: kKlauzula1.Selected;
     Datawyk: dDataW1.SelectedDate;
     emailM: temail1.Text;
     Kosztysadowe: Value(walKoSa1.Text);
     Kosztypelnomocnika: Value(walKoPel1.Text);
     UwagiObsluga: txtUObsluga1.Text;
     GodzSpr: txtGodzS1.Text;
     Sala: txtSala1.Text;
     KosztyKl: Value(txtKosztyKl1.Text);
     UwagiOrzeczenie: DataCardValue1.Text;
     Naleznoscizas: Value(tNaleznosciZas1.Text)
     }
    );;
    SubmitForm(EditForm1);;
    Navigate(
     scrPusty;
     ScreenTransition.None
    );;
    Refresh(Lista_v15);;
    SortByColumns(
     LargeList;
     "Licznik";
     Descending
    );;
    Navigate(
     StartScreen1;
     ScreenTransition.Cover
    )

     

     

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @Thoma2008 ,

    A lot of code to sort through, but firstly look at this bit

    With(
     {
     prevThreshold: Value(Value) * 499;
     nextThreshold: (Value(Value) + 1) * 499
     };
     If(
     tabNumer > Value;

    The item (Value) I imagine is referring to the sequence number and is therefore numeric - why are you wrapping it in Value() again. Secondly, have you checked the CountRows of the collection to see if it has gathered the expected number of records?

  • Thoma2008 Profile Picture
    57 on at

    @WarrenBelz 

    Thanks for looking with a fresh eye. I have not seen this value doubled.

    As for the second point, the collection contains exactly the same number of records.

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @Thoma2008 ,

    Intermittent problems are always the hardest to solve as you cannot easily or consistently replicate them. You have a very large number of fields you are patching there and I notice a number are ControlName.Selected, suggesting Choice fields? If so and the Items are Choices(ListName.FieldName), try

    {Value:ControlName.Selected.Value}

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Thoma2008 Profile Picture
    57 on at

    Hello @WarrenBelz 

    I do not understand the last sentence

    in my code is:

     OsobaMeryt: DataCardValue37.Selected;

    how can i correct it?

    How do you think my way of delegation is good or would you change?

    I read a lot on the internet but found no other way to use the "in" operator.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard