cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Sharepoint List with Patch missing required fields.

I am trying to build an app without using the datacards. So I have multiple inputs, and a patch function to submit them. However, when I try to submit the info I get "Some" errors that are missing because they are required. From 10 required columns when I look at the errors after doing the patch, I only see that 3 of my columns are actually required. When I look at the sharepoint list, the created record shows the newly added record but with warnings over the missing required information. Im not sure if this is an issue of using a sharepoint list that has required fields, but I cant find any information on how to make my inputs required AND for the inputs to actually populate the errors table when they are missing information.

This is how I am looking at the errors table:

UpdateContext({ErrorsContext:Concat(Errors('MyTable'),Message & Char(13) )});

ErrorLabel.Text = ErrorsContext

 

My sharepoint list complains about these fields missing, but the patch didnt show them as errors.... so the update goes thru:

CompleteWithErrors.png

 

Is there any way to make the fields required? or any way to manually add errors to the errors table? or to make sharepoint lists required columns actually be required?

19 REPLIES 19
Highlighted
Super User III
Super User III

Re: Sharepoint List with Patch missing required fields.

Hi @LuisTorres ,

What is your Patch code - please send as text.

Highlighted
Helper II
Helper II

Re: Sharepoint List with Patch missing required fields.

this is the code for my submit button:

 

UpdateContext({ErrorsContext:""});
Patch('MyTable',Defaults('MyTable'),
{Title:Now() & " " & User().Email,
Department:DepartmentInput.Text,
RequestorName:RequestorNameInput.Text,
RequestorEmail:RequestorEmailInput.Text,
RequestorPhone:RequestorPhoneInput.Text,
Term:TermInput.SelectedText,
Year:Value(YearInput.Text),
Subject:SubjectInput.Text
}
);
UpdateContext({ErrorsContext:Concat(Errors('Admin-CourseAdd'),Message & Char(13) )});

Highlighted
Helper II
Helper II

Re: Sharepoint List with Patch missing required fields.

After more experimentation it seems that required texts are not being picked up by the patch function, only numbers or multi selections bounce with the error. This is weird.

Highlighted
Super User III
Super User III

Re: Sharepoint List with Patch missing required fields.

Hi @LuisTorres ,

One thing I would try first is turning Now() to text 

Text(Now(),ShortDate) & " " & User().Email

The rest as you have said does not make a lot of sense presently as text should simply patch if the destination fields are also text.

 

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.

 

 

Highlighted
Helper V
Helper V

Re: Sharepoint List with Patch missing required fields.

I don't know how your particular app is behaving, BUT sometimes the patch functions drops errors because the record in Sharepoint you are updating to has blank columns. This can be corrected by using a updateif, instead of patch, on the blank cells in the record

Highlighted
Helper II
Helper II

Re: Sharepoint List with Patch missing required fields.

I havent seen the updateif function, I am only creating new records tho, so im not sure if it would have what im looking for.
For now I have been manually checking the required fields, and adding the errors manually to the errors table. This is working so far, however Im just curious as to why the sharepoint list with patch ignores the required text fields.

Highlighted
Helper V
Helper V

Re: Sharepoint List with Patch missing required fields.

Ok so after rereading original question and your responses, I am getting that you would like powerapps to not allow a user to submit until all the required fields have been filled out (correct me if thats not it) if so, what i usually do for this myself is just to set displaymode of the submission button to only switch to edit mode if all required fields have been input through a combination of isempty/isblank depending on each control type. That might help you as it doesnt require a check of column req status you hardcode the reqs on app side
Highlighted
Helper II
Helper II

Re: Sharepoint List with Patch missing required fields.

that is correct @TheRobRush  however disabling buttons without any sort of notification is horrible for accessibility, I really need the errors to be shown to the user. For me its weird that even after I declare the fields as required text, the patch function can insert a record without the required text missing... this only happens with text fields, any other data type for sharepoint lists works as intended except text fields.

Highlighted
Super User III
Super User III

Re: Sharepoint List with Patch missing required fields.

@LuisTorres ,

I will bow out of this and leave you in the capable hands of @TheRobRush 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Come join us today! Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published 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,113)