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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

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