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

Hi @LuisTorres ,

What is your Patch code - please send as text.

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) )});

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.

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.

 

 

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

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.

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

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.

@LuisTorres ,

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

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (10,106)