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 what im currently doing, however I was hoping the sharepoint list definition would do that automatically instead of me having spaghetti code all over the place for my 20 inputs.
@LuisTorresYah sorry, I do not think it is possible to stop the patch without writing that behavior into your button itself. Searched for a bit here just to be sure I hadn't missed something but nada.
Something you might want to do, add this into the button press if statement for when information has been left out
Notify( "Hello, World", NotificationType.Error )
That will allow you to have an error message pop up across the top of the screen for the user to simulate powerapps own error handling!
This is what im currently using for all my inputs:
If(IsBlank(DepartmentInput.Text),Collect(Errors('MyDataSource'),{Message:"Department field is required",Error:2}));
And after that I do this:
UpdateContext({ErrorsContext:Concat(Errors('MyDataSource'),Message & Char(13) )});
Then I have an error label:
ErrorLabel.Text = ErrorsContext
and of course the context is deleted when rerunning the checks.
This has been working so far, but I was hoping for a cleaner solution.... seems like the sharepoint lists required texts are behaving weird.
Sharepoint, at least as long as I have used PowerApps, has never kicked back patches if they were missing a required field, just leaves it blank with the error showing on the SharePoint field. Combed through a lot of people asking the question in last hour or so just to check the history on it, but have found no instance in which anyone gave a way to correct that behavior OUTSIDE of coding the error check into your button or Using an ////EDIT FORM/// instead of custom building your page from scratch. The edit form will handle checks for required fields
Here's how it looks when using an edit form
Actually im doing it from scratch, because of some styling requirements I have. Not really to fix the issue. I know its easier with the datacards...I actually had a version of the same app that used those. However making it from scratch is quite the learning process.
Yah then, unfortunately, you will have to continue checking manually as currently constructed. Maybe suggest this is as a future feature in the ideas forum?
Hi,
I recently have the same issue. I think I resolved it removing the Sharepoint List Connection, reseting Powerapps Studio and add it again. Then, obviously, I republished the app, and I cannoted replicate the error again.
Note:
My app was working fine until I configure a Sharepoint List Field to be required.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
214 | |
205 | |
86 | |
59 | |
38 |
User | Count |
---|---|
322 | |
260 | |
127 | |
86 | |
55 |