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

Collect Sharepoint not writing data

Hello!

I created an app that records data in a Sharepoint list.

The user fills in several fields and then submits via a button.

However some users reported that they filled out and sent the data, but in the Sharepoint List the data does not appear.

How can I check if the data is actually written by PowerApps? How can I handle Collect errors? In the formula bar, nothing is wrong, so many users are able to save it.

Everyone has the same permission on the list.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Collect Sharepoint not writing data

Hi @JarbasMartinho ,

Actually, you could use Patch function to save data back to the Person field in your SP List.

 

Please take a try with the following Patch formula:

Patch(
      Risco;
      Defaults(Risco);
     { 
      Title: lb_mat.Text & Text(Now(); "[$-pt-BR]ddmmhhmmss/yyyy");
      Data: Today();
      Data_x0020_Nascimento: Date(Value(Right(data_nasc.Text; 4));Value(Mid(data_nasc.Text; 4; 2));Value(Mid(data_nasc.Text; 1; 2)));
      Matr_x00ed_cula: lb_mat.Text;
      matValor: Value(lb_mat.Text);
      Empregado: {                                                 // Modify formula here
                   Claims:"i:0#.f|membership|" & Lower(User().Email);
                   DisplayName: User().FullName;
                   Email: User().Email;
                   Department: "";
                   JobTitle: "";
                   Picture: ""
                  };
      Idade: Value(idade.Text);
      Local: cidade.Text;
      UF: uf.Text;
      Área: UsuáriosdoOffice365.MyProfileV2().department;
      Cardiopata: cardio.Selected.Value;
      Diabetes: diabetes.Selected.Value;
      Hipertens_x00e3_o: hiper.Selected.Value;
      Doen_x00e7_a_x0020_Respirat_x00f: respira.Selected.Value;
      Cancer: cancer.Selected.Value;
      Autoimune: autoimune.Selected.Value;
      Esteve_x0020_em_x0020_contato_x0: p1.Selected.Value;
      Apresenta_x0020_febre_x0020__x00: p2.Selected.Value;
      Apresenta_x0020_tosse_x0020_seca: p3.Selected.Value;
      Apresenta_x0020_dificuldades_x00: p4.Selected.Value;
      Apresenta_x0020_cansa_x00e7_o_x0: p5.Selected.Value;
      Apresenta_x0020_dor_x0020_de_x00: p6.Selected.Value;
      Apresenta_x0020_dores_x0020_no_x: p7.Selected.Value;
      Apresenta_x0020_nariz_x0020_entu: p8.Selected.Value;
      Apresenta_x0020_coriza_x003f__x0: p9.Selected.Value;
      Apresenta_x0020_diarreia_x003f__: p10.Selected.Value;
      DTvalor: Value(Text(Today(); "yyyymmdd"));
      PtoComorbidade: soma;
      PtoQuest: soma1;
      Risco_x0020_Comorbidade: comorbidades;
      Risco_x0020_Questionario: questionario;
      Latitude: Text(Location.Latitude);
      Longitude: Text(Location.Longitude);
      NomeLocal: myLocation.name
    }
);;

 

In addition, please ask your end users with this issue to clear cache of your browser, then access your shared app again, provide their credential to this shared app, check if the issue is solved.

 

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

5 REPLIES 5
Highlighted
Super User
Super User

Re: Collect Sharepoint not writing data

You can Notify the user OnSuccess or failure of the form being submitted.

 

OnSuccess property:

Notify("Record was sent to the Datasource successfully")

 

OnFailure

Notify ("Data could not be submitted")

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

Highlighted
Community Support
Community Support

Re: Collect Sharepoint not writing data

Hi @JarbasMartinho ,

How do you submit your data back to your SP List? Using SubmitForm function, Patch function or Collect function?

 

If you submit your data back to your SP List using SubmitForm function, please consider set the OnSuccess property of the Edit form to following:

Notify("Submitted Successfully", NotificationType.Success)

set the OnFailure property of the Edit form to following:

Notify("Submitted Failure", NotificationType.Error)

 

If you use Patch function to submit data back to your SP List, please use the following formula:

If(
   IsEmpty(
           Errors(
                  'Your SP List',
                  Patch(
                        'Your SP List',
                         Defaults('Your SP List'),
                         {
                             Title: TitleTextBox.Text,
                             Column2: TextInput2.Text,
                             Column3: TextInput3.Text,
                             ...
                         }
                  )
           )
   ),
   Notify("Submitted Successfully", NotificationType.Success),
   Notify("Submitted Failure -- Patch function executes failure", NotificationType.Error)
)

Please consider take a try with above formula to submit data back to your SP List, then check if the issue is solved.

 

Please make sure each end user has Edit permission to your SP List, and they have owned proper license to access PowerApps feature.

 

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.
Highlighted
Frequent Visitor

Re: Collect Sharepoint not writing data

Hi! I use Collect.

I didn't use Patch because I couldn't record the People field for Sharepoint.

Empregado: { Claims: User().Email };

 

Collect(Risco;
{ 
    Title: lb_mat.Text & Text(Now(); "[$-pt-BR]ddmmhhmmss/yyyy");
    
   
    Data: Today();
    Data_x0020_Nascimento: Date(Value(Right(data_nasc.Text; 4));Value(Mid(data_nasc.Text; 4; 2));Value(Mid(data_nasc.Text; 1; 2)));

    Matr_x00ed_cula: lb_mat.Text;
    matValor: Value(lb_mat.Text);

    
    Empregado: { Claims: User().Email };
    Idade: Value(idade.Text);

    Local: cidade.Text;
    UF: uf.Text;
    Área: UsuáriosdoOffice365.MyProfileV2().department;

    
    Cardiopata: cardio.Selected.Value;
    Diabetes: diabetes.Selected.Value;
    Hipertens_x00e3_o: hiper.Selected.Value;
    Doen_x00e7_a_x0020_Respirat_x00f: respira.Selected.Value;
    Cancer: cancer.Selected.Value;
    Autoimune: autoimune.Selected.Value;
    
    Esteve_x0020_em_x0020_contato_x0: p1.Selected.Value;
    Apresenta_x0020_febre_x0020__x00: p2.Selected.Value;
    Apresenta_x0020_tosse_x0020_seca: p3.Selected.Value;
    Apresenta_x0020_dificuldades_x00: p4.Selected.Value;
    Apresenta_x0020_cansa_x00e7_o_x0: p5.Selected.Value;
    Apresenta_x0020_dor_x0020_de_x00: p6.Selected.Value;
    Apresenta_x0020_dores_x0020_no_x: p7.Selected.Value;
    Apresenta_x0020_nariz_x0020_entu: p8.Selected.Value;
    Apresenta_x0020_coriza_x003f__x0: p9.Selected.Value;
    Apresenta_x0020_diarreia_x003f__: p10.Selected.Value;

    DTvalor: Value(Text(Today(); "yyyymmdd"));
    PtoComorbidade: soma;
    PtoQuest: soma1;
    Risco_x0020_Comorbidade: comorbidades;
    Risco_x0020_Questionario: questionario;
    Latitude: Text(Location.Latitude);
    Longitude: Text(Location.Longitude);
    NomeLocal: myLocation.name
}
);;

  

Highlighted
Frequent Visitor

Re: Collect Sharepoint not writing data

Hi @v-xida-msft 

 

I checked all permissions and they are ok. I found that if the user accesses the app via cell phone he can record it on the sharepoint list. But if he accesses it via a web browser he does not record.

 

When I access it via a web browser, I can record, but other users cannot. Only by cell phone can they save the data.

Is it a bug?

Highlighted
Community Support
Community Support

Re: Collect Sharepoint not writing data

Hi @JarbasMartinho ,

Actually, you could use Patch function to save data back to the Person field in your SP List.

 

Please take a try with the following Patch formula:

Patch(
      Risco;
      Defaults(Risco);
     { 
      Title: lb_mat.Text & Text(Now(); "[$-pt-BR]ddmmhhmmss/yyyy");
      Data: Today();
      Data_x0020_Nascimento: Date(Value(Right(data_nasc.Text; 4));Value(Mid(data_nasc.Text; 4; 2));Value(Mid(data_nasc.Text; 1; 2)));
      Matr_x00ed_cula: lb_mat.Text;
      matValor: Value(lb_mat.Text);
      Empregado: {                                                 // Modify formula here
                   Claims:"i:0#.f|membership|" & Lower(User().Email);
                   DisplayName: User().FullName;
                   Email: User().Email;
                   Department: "";
                   JobTitle: "";
                   Picture: ""
                  };
      Idade: Value(idade.Text);
      Local: cidade.Text;
      UF: uf.Text;
      Área: UsuáriosdoOffice365.MyProfileV2().department;
      Cardiopata: cardio.Selected.Value;
      Diabetes: diabetes.Selected.Value;
      Hipertens_x00e3_o: hiper.Selected.Value;
      Doen_x00e7_a_x0020_Respirat_x00f: respira.Selected.Value;
      Cancer: cancer.Selected.Value;
      Autoimune: autoimune.Selected.Value;
      Esteve_x0020_em_x0020_contato_x0: p1.Selected.Value;
      Apresenta_x0020_febre_x0020__x00: p2.Selected.Value;
      Apresenta_x0020_tosse_x0020_seca: p3.Selected.Value;
      Apresenta_x0020_dificuldades_x00: p4.Selected.Value;
      Apresenta_x0020_cansa_x00e7_o_x0: p5.Selected.Value;
      Apresenta_x0020_dor_x0020_de_x00: p6.Selected.Value;
      Apresenta_x0020_dores_x0020_no_x: p7.Selected.Value;
      Apresenta_x0020_nariz_x0020_entu: p8.Selected.Value;
      Apresenta_x0020_coriza_x003f__x0: p9.Selected.Value;
      Apresenta_x0020_diarreia_x003f__: p10.Selected.Value;
      DTvalor: Value(Text(Today(); "yyyymmdd"));
      PtoComorbidade: soma;
      PtoQuest: soma1;
      Risco_x0020_Comorbidade: comorbidades;
      Risco_x0020_Questionario: questionario;
      Latitude: Text(Location.Latitude);
      Longitude: Text(Location.Longitude);
      NomeLocal: myLocation.name
    }
);;

 

In addition, please ask your end users with this issue to clear cache of your browser, then access your shared app again, provide their credential to this shared app, check if the issue is solved.

 

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

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

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.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response 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 (3,322)