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:
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?
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.
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.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
204 | |
181 | |
69 | |
36 | |
33 |
User | Count |
---|---|
342 | |
274 | |
115 | |
75 | |
58 |