cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bdc604
Level 8

SubmitForm: Display error msg if item already exists in unique SP column?

I have a form that successfully creates a new SP list item if the if the unique column is not being duplicated. If the user attempts to submit an item where that value already exists, the new list item is not created. Good.

But on submit with this error condition, it just sits there and does nothing. OnFailure doesn't seem to do anything. I assumed creating a label and changing its visibility in the OnFailure event would work (LabelError.Visible=true).

How can I display something to the user to indicate the problem when SubmitForm fails? Validation and datasourceinfo don't seem to handle this.

1 ACCEPTED SOLUTION

Accepted Solutions
bdc604
Level 8

Re: SubmitForm: Display error msg if item already exists in unique SP column?

Solved. Simply put any of the statements below in the OnFailure event:

 

Notify( "This value already exists...")  - should show a blue banner
Notify( "This value already exists...", Error )  - should show a red banner
Notify( "This value already exists...", Warning )   - should show an orange banner

 

Problem, I get a green banner with all the above, lol.

 

Reference:

https://powerapps.microsoft.com/en-us/blog/showerror-function-is-changing-its-name-to-notify-as-it-l...

 

5 REPLIES 5
bdc604
Level 8

Re: Error msg for attempting duplication of unique SP column?

It doesn't have to return the specific error, but I do need to display a custom error message if the form fails to submit for any reason...

Highlighted
bdc604
Level 8

Re: SubmitForm: Display error msg if item already exists in unique SP column?

Anything, throw me a bone here. SubmitForm fails... for any reason, doesn't matter what... display message to user...

 

This is literally the only condition in which the form could fail so its easy on my end to know what the problem is. Not so much for the end user...

bdc604
Level 8

Re: SubmitForm: Display error msg if item already exists in unique SP column?

Solved. Simply put any of the statements below in the OnFailure event:

 

Notify( "This value already exists...")  - should show a blue banner
Notify( "This value already exists...", Error )  - should show a red banner
Notify( "This value already exists...", Warning )   - should show an orange banner

 

Problem, I get a green banner with all the above, lol.

 

Reference:

https://powerapps.microsoft.com/en-us/blog/showerror-function-is-changing-its-name-to-notify-as-it-l...

 

HarryO365
Level: Power Up

Re: SubmitForm: Display error msg if item already exists in unique SP column?

You have to enter: Notify("some kind of text", NotificationType.Error)

GK_BPL
Level: Powered On

Re: SubmitForm: Display error msg if item already exists in unique SP column?

Hi,

 

I have a question, I would like to know the formula you used to not let a user submit the same item twice.

So basically if the item is already pesent in the gallery the user can't submit it and it will show the Notify text,

 

I think I know how to use the Notify but how do I stop the user from submitting an item if it already exists???

 

Thank you loads Smiley Happy