cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
QuinceK
Frequent Visitor

SubmitForm failed because of duplicate values in SparePointList

Hi!

I have started an app from SharePoint data to create a form "EditForm1". The data from this form should be submitted to a Sharepoint list called "List 1" and then the user is navigated to  "SuccessScreen".

There are two fields in the list which data has to be unique ("ClientSite", "AppName"). SubmitForm and navigating to SuccessScreen works fine while there are no duplicates for "ClientSite" and "AppName" . 

When the user types in duplicate data and submits data to Sharepoint it appears an error message but the user is still forwarded to the SuccessScreen.

 

I am trying to keep the user on the form screen and not to navigate to SuccessScreen until he changed the duplicate data and there is no error from Sharepoint.

 

I would be thankful for any suggestions... 


  

1 ACCEPTED SOLUTION

Accepted Solutions
v-albai-msft
Community Support
Community Support

Hi @QuinceK,

Do you mean that you don't want users to create a new item with an existing value of ClientSite column or AppName column?

If yes, assuming these two columns are both Text column, I did a test for your reference:

1. See my EditFrom1, DataCardValue13 is the name of my ClientSite column, and DataCardValue14 is the name of my AppName column:

v-albai-msft_0-1617606060196.png

2. Set OnSelect property of your submit button to:

 

If(DataCardValue13 in list7.ClientSite||DataCardValue14 in list7.AppName,Notify("you are typing in duplicate data for ClientSite or AppName column. Please change to a unique value.",NotificationType.Error),SubmitForm(EditForm1))

 

v-albai-msft_0-1617606408622.png

Best regards,

Allen

View solution in original post

3 REPLIES 3
Elias-V
Advocate I
Advocate I

Where is your navigate code?

When you call SubmitForm(form) it can either run an OnSuccess or OnFailure on the form itself, so if you put the Navigate on the OnSuccess, it won't navigate away if it fails.

v-albai-msft
Community Support
Community Support

Hi @QuinceK,

Do you mean that you don't want users to create a new item with an existing value of ClientSite column or AppName column?

If yes, assuming these two columns are both Text column, I did a test for your reference:

1. See my EditFrom1, DataCardValue13 is the name of my ClientSite column, and DataCardValue14 is the name of my AppName column:

v-albai-msft_0-1617606060196.png

2. Set OnSelect property of your submit button to:

 

If(DataCardValue13 in list7.ClientSite||DataCardValue14 in list7.AppName,Notify("you are typing in duplicate data for ClientSite or AppName column. Please change to a unique value.",NotificationType.Error),SubmitForm(EditForm1))

 

v-albai-msft_0-1617606408622.png

Best regards,

Allen

View solution in original post

QuinceK
Frequent Visitor

Thanks a lot, Allen. Worked perfectly. 😊

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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