cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ken_V
Regular Visitor

Power Apps Form not displaying SharePoint Error

My Power Apps form that is connected to SharePoint (SP) is not displaying the SP error -- specifically that user data for a field ("PR") cannot be loaded into the SP list because said field is set to unique. 

Although, I am new to Power Apps, I am not new to SP.

I cannot find / see the SP error message letting the user know why the form appears to be doing nothing after the user uses the "Save" command.  The SP error message is not on the the App screen or in the form's "ErrorMessage1" (which is set to "Parent.Error") card section for said field.

At this point I am not using the Patch CMD, just the standard "Save" CMD, and when duplicate data is not entered the Power Apps form does adds new entries to the SP list as well as allowing one to edit existing entries.


What do I need to check, and what do I need to check for?

1 ACCEPTED SOLUTION

Accepted Solutions
Ken_V
Regular Visitor

Unsolved but a solution is working.

 

Replaced (i.e. deleted) Customized Form w/App.   Now short helpful error messages are appearing.  (E.g. "PR is required." in the PR card's "ErrorMessage" box, and a custom banner message -- "Each "PR" must be unique.  The "PR" you entered already exits.")

View solution in original post

4 REPLIES 4
Nogueira1306
Community Champion
Community Champion

1. I am not sure why is that giving you a error but what you can try is to set this on OnSucess proeprty of the form: Navigate(ScreenSucess) 

And this on OnFailure of the form: Notify("Error!")

2. If you want to edit, my advice is that you have a gallery with the itens and when you select one, you navigate to a new screen with the a form that item is set to "Gallery1.Selected"

3. You can also do this to check if it exists or you need to update (using patch):

If(
CountRows(Filter(YourDataSource, UniqueField = PeoplePicker.Selected.Name)) >= 1,

//UPDATE ITEM ,

//CREATE NEW

)

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,
Gonçalo Nogueira

Check my LinkedIn!

Check my User Group (pt-PT)!

Mr. Nogueira, thank you for trying to help me w/solving this problem.

 

1.)  The problem is I (/ an end user) is not seeing any error message from SP.  In this case I am purposely trying to enter duplicate in to a unique field, but I'm not seeing the message from SP letting me know why the entry is not moving forward -- this is why it will appear to the regular user that the form is not working.  If I set the SharePointFrom1's " OnFailure" to:  Notify("Error!") then it my understanding of the Notify function that the message to the user would be just "Error!" which is not specific enough.   

(For now I'm good w/the standard SP error message for not unique (or duplication) -- perhaps later I will add to said message.)

As for setting SharePointForm1's "OnSucess" to: "Navigate(ScreenSucess)" I realized I would have to first and a ScreenSucess screen.  However, once said screen is added would "OnSucess" = "Navigate(ScreenSucess)" only work if I'm using a "Submit" button, or will it work w/the standard "Save" feature?  (In the future I may very well add button for submission of data via Patch, but I first want to get what I have working before I advance.)

 

Note currently SharePointForm1's "OnSuccess" = ResetForm(Self); RequestHide()

and "OnFailure" = IsEmpty(Errors(['SP List Name']))

 

2.)  I'm not using Galleries, so the user navigates to the item to be edited / updated via the SP list.

 

3.)  I'm very interested in using Patch per the formula you provided. 

Am I correct that said formula would be placed in the yet-to-be-created Submit button's "OnSelect"?  

 

Note "PR" is a text field so I believe the example formula need to be adjusted -- yes?

 

Before I add a "Submit" button that uses Patch, I would like to fix the problem of the error message from SP not being displayed on either the Power Apps screen or form.

 

3rd Note.  After changing SharePointForm1'a "OnFailure" to:  Notify(First(Errors('SP List Name')).Message), I am now getting a very unhelpful message of "The requested operation is invalid" only on the form, but not in DataCard1's ErrorMessage1 box.

Ken_V
Regular Visitor

Changed both the Card's "ErrorMessage1" Text to:  SharePointForm1.Error

and now the full error message from SP does contain useful info. 

I.e. "The list item could not be added or updated because duplicate values were found in the following field(s) in the list: [PR]"

However, it also contains a lot of other info. that the user does not need to see as it is confusing, so how do I limit the error message display to just the part I wrote above?

Ken_V
Regular Visitor

Unsolved but a solution is working.

 

Replaced (i.e. deleted) Customized Form w/App.   Now short helpful error messages are appearing.  (E.g. "PR is required." in the PR card's "ErrorMessage" box, and a custom banner message -- "Each "PR" must be unique.  The "PR" you entered already exits.")

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,178)