cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FedeCandotto
Helper I
Helper I

SharePointIntegration does not save data in sharepoint list

Hi everyone! 🙂

I'm building a form with Sharepoint Integration. This form is used to register for courses.

 

I don't understand why when I submit the form the data is not saved in the database

These are some formulas for better comprehension:

 

First of all I calculated how many places of the course have already been booked:

DataCardValue_Booked - Defaults:

Count(Filter('Electives Reservations'; ComboBox_Courses.Selected.Value = Elective.Value).ID)

 

Elective Reservation = list name

ComboBox_Courses = combobox in the form where I chose the course I want

 

then I calculate how many places are left compared to the maximum number of registrations

Label - Text

If(IsBlank(DataCardValue_PlacesAvailable);10;DataCardValue_PlacesAvailable-DataCardValue_Booked)

 

through the email and the ID of the course I verify that I have not previously registered for the course. If the number of my enrollments in the course is less than 1, I set the "places" variable which contains the number of places still available, and also submit the form. Otherwise, I reset it

 

SharePointIntegration - OnSave

If(Count(Filter('Electives Reservations'; email = DataCardValue_Email.Text; Elective.Value = ComboBox_Corsi.Selected.Value).ID) < 1;
Set(postili;(Posti.Text));;SubmitForm(SharePointForm1);;ResetForm(SharePointForm1))

 

If the amount of spots still available is greater than zero, navigate to the Feedback_Successfull screen; otherwise navigate to Feedback

SharePointForm - OnSuccess

If(Value(postili)>0;
Navigate(Feedback_Successfull;ScreenTransition.None);;ResetForm(SharePointForm1);
Navigate(Feedback;ScreenTransition.None);;ResetForm(SharePointForm1))

 

Feedback_Successfull and Feedback are two screens that contain a button

 

Button Feedback_Successfull:

ResetForm(SharePointForm1);; RequestHide();;Refresh('My Reservations')

 

Button Feedback

ResetForm(SharePointForm1);; RequestHide();;Refresh('My Reservations')

 

Can anyone tell me why when the data is not saved on the SharePoint list?

Probably something is wrong at OnSuccess, but I don't understand what is it.

Thank you in advance 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
FedeCandotto
Helper I
Helper I

I fixed it on my own, and all this information was unnecessary.

 

The from didn't save the data to the database because I unintentionally set the REQUIRED property of a hidden DataCard to =true.

As in this case, It's impossible to save a form if a required field has not been filled in.

View solution in original post

1 REPLY 1
FedeCandotto
Helper I
Helper I

I fixed it on my own, and all this information was unnecessary.

 

The from didn't save the data to the database because I unintentionally set the REQUIRED property of a hidden DataCard to =true.

As in this case, It's impossible to save a form if a required field has not been filled in.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,254)