cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MaruthiKiran_jk
New Member

How to check duplicate item in list using powerapps.

Hi,

How can i check if an item is already exist in sharepoint list using powerapps.i,e user should not be able to register to the same event again.

(Note : it is not a SharePoint list form.)


Event                                      EmpEmail

SharepointSaturday               Maruthi@gmail.com

Azure boot camp                   Maruthi@gmail.com

 

Appreciate your help.

 

I have two list :

1: Registration list : where i create items on click of submit button in powerapps

2: Events list : is the source list ,where lookup Events column in powerapps.

Attached is the screenshot for reference.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @MaruthiKiran_jk ,

Have you solved your problem?

 

Based on the needs that you mentioned, I think the LookUp function could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

Set the OnSelect property of the "Click here to Register" button to following:

If(
   !IsBlank(LookUp('Registration list', Event = EventDropdown.Selected.Value && EmpEmail = EmpEmailTextBox.Text)),
   Notify("The user " & EmpEmailTextBox.Text & " has submitted same event for " & EventDropdown.Selected.Value & " already. Do not submit repeatly!", NotificationType.Error),
   SubmitForm(EditForm1);ResetForm(EditForm1)
)

 

Please consider take a try with above solution, check if the issue is solved. If you have solved your problem, please consider go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
eka24
Super User
Super User

Your question is not clear but generally use:
If(CountRows(Filter(DataSource,Name = "Value1")) > 0,"Exist","Does Not Exist")

datasource could be table name or List
Name is the Column or field name
mdevaney
Super User
Super User

@MaruthiKiran_jk 

You can use code like this in the OnSelect property of your Submit button to pre-check if the email already exists for a given event.

 

If(
    IsBlank(LookUp(your_registration_list, Event = your_event_name And EmpEmail = User().Email)),
    SubmitForm(your_form_name)
)

 

Note: you must input references to your own datasources/controls in this forumla

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Hi @mdevaney   i have tried as you said, but it is not working as expected, form is not being submitted to the list.

Following is the formula i have used:

 

On Select :  If(IsBlank(LookUp(Registration7,Event = "Agile ways of working" And EmpEmail=varUserEmail)),SubmitForm(Form1);NewForm(Form1))

 

 

Appreciate your help.

@MaruthiKiran 

This is the section of code you should focus on.   Your form is submitting because the combination of Event name and User Email do not already exist.

Event = "Agile ways of working" And EmpEmail = varUserEmail

 

Can you try typing in a combination of event and email you know are already in the list as a test and submit the form?

Event = "Agile ways of working" And EmpEmail = jsmith@xyzcompany.com"

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Hi @eka24 ,

 

i have used the formula as you said. But it is not working as expected. it is showing me that item "exist"  in list even though it is not there.Following is the formula :

 

If(CountRows(Filter(Registration7,Event="Agile ways of working"))>0,"Exist","Does Not Exist")

 

Appreciate your help.

@mdevaney  , Thanks a lot ,form is being submitted now. Following is the formula i have used. 

 

 

If(IsBlank(LookUp(Registration7,Event = Dropdown1.Selected.Event And EmpEmail= "muk@novozymes.com")),SubmitForm(Form1);NewForm(Form1))

@MaruthiKiran 

Does this mean we found the solution?

yes 🙂

@MaruthiKiran

Then you should "Accept the Solution" that led to the answer.  This will help others find the answer more quickly when they review this thread.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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