cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NewLearner1
Helper I
Helper I

Check duplicate before saving in sharepoint

Hi,

 

I am new to powerapps.I have an App with problem. I don't want users to save duplicate data in sharepoint.

I have to a sharepoint list named as 'SPList' with multiple columns and I want to check duplicates for two columns before saving data in SP.

 

Example :

I have SP with the columns

System Name         System Description

------------------      ------------------------

System ABC             Desc A

System XYZ             Desc X

System PQR            Desc P

....etc have multiple entries

 

When I am adding new entry to Sharepoint it should check for below 

System ABC - Desc X ===> it should accept the entry 

System XYZ - Desc A ===> it should accept the entry

System ABC - Desc A ===>it should give error as duplicate entry

System XYZ - Desc X ===>it should give error as duplicate entry

 

Please suggest. Thanks in advance.

19 REPLIES 19
Jitendra_jangid
Resolver II
Resolver II

Hi, 

 

Can you try enforcing unique value in SharePoint Field.

Jitendra_jangid_1-1610022972810.png

 

It will take unique value only for that particular column.

I want to make System Description unique based on System Name column.

 the output like below

Example :

I have SP with the columns

System Name         System Description

------------------      ------------------------

System ABC             Desc A

System XYZ             Desc X

System PQR            Desc P

....etc have multiple entries

 

When I am adding new entry to Sharepoint it should check for below 

System ABC - Desc X ===> it should accept the entry 

System XYZ - Desc A ===> it should accept the entry

System ABC - Desc A ===>it should give error as duplicate entry

System XYZ - Desc X ===>it should give error as duplicate entry

eka24
Super User
Super User

Try this:

If(
IsBlank(LookUp(Datasource,SystemName= TextInput1.Text)) &&
IsBlank(LookUp(Datasource,SystemDescription = TextInput2.Text)),
SubmitForm(Form1),
Notify("Already Exist"))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Hi @eka24 ,

 

I have tried this, As I have System Name as dropdown getting the error as "Invalid argument type".

 

If(
IsBlank(LookUp(SPList,'System Name'= DataCardValue1.Selected.Value)) &&
IsBlank(LookUp(SPList,'System Description' = DataCardValue2.Text)),
SubmitForm(Form1),
Notify("Already Exist"))

 

getting error for this line 'System Name'= DataCardValue1.Selected.Value for = to 'Invalid argument type'.

 

 

 

eka24
Super User
Super User

Show the formula on the items property of the dropdown

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Hi @eka24 ,

The Item property of my dropdown 'System Name'

Choices([@SPList].SystemName)

eka24
Super User
Super User

Change the formula to:

If(
IsBlank(LookUp(SPList,'System Name'= DataCardValue1.Selected.SystemName)) &&
IsBlank(LookUp(SPList,'System Description' = DataCardValue2.Text)),
SubmitForm(Form1),
Notify("Already Exist"))

Hi @eka24 ,

 

I have changed formula to the below

If(
IsBlank(LookUp(SPList,'System Name'= DataCardValue1.Selected.SystemName)) &&
IsBlank(LookUp(SPList,'System Description' = DataCardValue2.Text)),
SubmitForm(Form1),
Notify("Already Exist"))

 

I am getting error to 'System Name'= DataCardValue1.Selected.SystemName this line for SystemName is-- 

"Name isn't valid.This identifier isn't recognized."

 

And even I have tried the below code but no luck 😞

If(
IsBlank(LookUp(SPList,'System Name'.Value= DataCardValue1.Selected.SystemName)) &&
IsBlank(LookUp(SPList,'System Description' = DataCardValue2.Text)),
SubmitForm(Form1),
Notify("Already Exist"))

 

Please suggest.


eka24
Super User
Super User

If the formula below still have issues, Take a screenshot of the formula on the Drop down and post.

Again is the name of your form Form1?

 

If(

IsBlank(LookUp(SPList,'System Name'= DataCardValue1.Selected.'System Name')) &&

IsBlank(LookUp(SPList,'System Description' = DataCardValue2.Text)),

SubmitForm(Form1),

Notify("Already Exist"))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,980)