web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Restrict Duplicate Ent...
Power Apps
Unanswered

Restrict Duplicate Entry for the End User Using form

(0) ShareShare
ReportReport
Posted on by 709

Hi Team,

Greeting for the Day!

I need help in building the formula. The ask is- How do I restrict the user for duplicate entry so that they won't be able to make the same information input on the form.

I have a Date and a couple of text fields.

 

DateFeild Name = DataCardValue25
Enterprise ID = DataCardValue26
LOB = DataCardValue27

 

These three Feild are my key for restricting the user for not giving me duplicate entry.

 

Some sorts of the pop-up and barring them for duplicate entry.

 

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @akbarmahfuzalam 

     

    Consider setting the DisplayMode property of your submit button...

    If(
     CountRows(yourDataSource, 
     DataField=DataCardValue25.Text && 
     EnterpriseID=DataCardValue26.Text && 
     DataField=DataCardValue25.Text
     ) > 0,
     Disabled,
     Edit
    )

     

    I hope this is helpful for you.

  • akbarmahfuzalam Profile Picture
    709 on at

    Hi Randy,

    Thanks for your quick response. Getting one small error. If you could fix that, please

     

    below are the key fields for restricting the user

     

    1. Date Feild =  DataCardValue25

    2. EnterpriseID =  DataCardValue26

    3. LOB =  DataCardValue27

     

    Error description.JPG

     

    If(IsBlank((DataCardValue33.Text))|| IsBlank(DataCardValue25.SelectedDate),DisplayMode.Disabled,DisplayMode.Edit),
    If(
    CountRows(UtilizationException,
    DataField=DataCardValue25.Text &&
    EnterpriseID=DataCardValue26.Text &&
    DataField=DataCardValue25.Text
    ) > 0,
    Disabled,
    Edit
    )

     

    Duplicate entry2.JPG

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @akbarmahfuzalam 

    Your syntax is incorrect...should be this:

    If(
     IsBlank(DataCardValue33.Text) ||
     IsBlank(DataCardValue25.SelectedDate) ||
     CountRows(yourDataSource, 
     DataField=DataCardValue25.Text && 
     EnterpriseID=DataCardValue26.Text && 
     DataField=DataCardValue25.Text
     ) > 0,
     Disabled,
     Edit
    )

     

  • akbarmahfuzalam Profile Picture
    709 on at

     Hi

     

    Invalid number of arguments: received 2, expected 1.

     

    Error1.JPG

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @akbarmahfuzalam 

    DUH....sorry, too many things going on and trying to respond to posts too today.

    I left out an important part:

     

    If(
     IsBlank(DataCardValue33.Text) ||
     IsBlank(DataCardValue25.SelectedDate) ||
     CountRows(
     Filter(UtilizationException, 
     DataField=DataCardValue25.Text && 
     EnterpriseID=DataCardValue26.Text && 
     DataField=DataCardValue25.Text) 
     ) > 0,
     Disabled,
     Edit
    )

     

     

    Kind of helps to have the Filter statement in there 😉

    Sorry about that!

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @akbarmahfuzalam 

    Also...make sure you are adjusting the DataField, EnterpriseID and the other DataField names to correspond to your datasource column names.

  • akbarmahfuzalam Profile Picture
    709 on at

    Hi Randy,

     

    There is no error this time, however, I can see duplicate entry in the SharePoint and its the submit button is also not got greyed.

     

    akbarmahfuzalam_1-1594836164718.png

     

    If(
    IsBlank(DataCardValue33.Text) ||
    IsBlank(DataCardValue25.SelectedDate) ||
    CountRows(
    Filter(UtilizationException,
    DataField=DataCardValue25.Text &&
    EnterpriseID=DataCardValue26.Text &&
    DataField=DataCardValue27.Text)
    ) > 0,
    Disabled,
    Edit
    )

    akbarmahfuzalam_0-1594836047766.png

     

  • akbarmahfuzalam Profile Picture
    709 on at

    The Button is greyed out after the formula I put but the entry is still coming duplicate and it's allowing the user to get the entry into SharePoint.

     

    If(
    IsBlank(DataCardValue33.Text) ||
    IsBlank(DataCardValue25.SelectedDate) ||
    CountRows(
    Filter(UtilizationException,
    Shiftdate=DataCardValue25.SelectedDate &&
    Enterprise_ID=DataCardValue26.Text &&
    LOB=DataCardValue27.Text)
    ) > 0,
    Disabled,
    Edit
    )

     

    Whereas, it should stop the user by not allow the button to live. it should be greyed out.

     

    SP DuplicateJPG.JPG

     

    Do we need to write few code OnSlected =Set(varRecord(lookup(UtilizationException,Shiftdate=DataCardValue25.SelectedDate &&
    Enterprise_ID=DataCardValue26.Text &&
    LOB=DataCardValue27.Text));

    If(IsBlank(varRecord.ID),

    Set(varShowSpinner,true);SubmitForm(Form1);Notify("Data Uploaded Successfully",NotificationType.Success,2000);ResetForm(Form1);Set(varShowSpinner,false)..

     

    Just a thought.. I know there is some issue with the formula. it's not correctly formated. 

  • eka24 Profile Picture
    20,923 on at

    In addition to @RandyHayes you can try giving the user information On the OnSelect of the Submit Button:

    If(IsBlank(LookUp(UtilizationException,Shiftdate= DataCardValue25.SelectedDate, DateField)), Notify("Date already exist"),

      If(IsBlank(LookUp(UtilizationException,EnterpriseID= DataCardValue26.Text, EnterpriseID)), Notify("Enterprise ID Already Exist"),

      If(IsBlank(LookUp(UtilizationException,LOB= DataCardValue27.Text,LOB)), Notify("LOB Already Exist"),

      SubmitForm(Form1))))

     

    ------------
    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.

  • akbarmahfuzalam Profile Picture
    709 on at

    Thanks for helping me..

     

    Yes, I am using the Datapicker.

     

    But every time i am pressing the button it giving me this info irrespective to what date I select or what person I select 

    akbarmahfuzalam_0-1594838322185.png

     

    akbarmahfuzalam_1-1594838389000.png

     

    The formula used OnSelected---------

    If(IsBlank(LookUp(UtilizationException,Shiftdate = DataCardValue25.SelectedDate, Shiftdate)), Notify("Date already exist"),

    If(IsBlank(LookUp(UtilizationException,Enterprise_ID= DataCardValue26.Text, Enterprise_ID)), Notify("Enterprise ID Already Exist"),

    If(IsBlank(LookUp(UtilizationException,LOB= DataCardValue27.Text,LOB)), Notify("LOB Already Exist"),

    SubmitForm(Form1))))

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard