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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Data repeat restriction
Power Apps
Answered

Data repeat restriction

(0) ShareShare
ReportReport
Posted on by 95

Hello community! I have a doubt. I am creating an app that basically what it does is take a date and a data (Number of hours worked), no more than that. What I would like is that, if the user enters a date that he has already entered before, the App does not allow him to advance. Basically the date field cannot repeat dates. Is there a way to do this? Thanks!

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,409 Most Valuable Professional on at

    Hi @Labraham36 ,

    When you refer to "entered before", is this contained in a List which also contains the user's details. If so, you would do a Lookup on the list on the OnChange of the Date Picker (note you will get a Delegation warning on this)

    If(
     !IsBlank( 
     LookUp(
     YourListName,
     UserField=User().FullName && 
     Text(Self.SelectedDate,ShortDate)=Text(YourDateFiled,ShortDate),
     ).YourDateField
     ),
     Notify("Date used previously,Error);
     Reset(Self)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Labraham36 Profile Picture
    95 on at

    Thank you for your answer! But I think I explained it wrong. The problem is the following: My App only receives two data, a date and a number of hours corresponding to that date. What I need is that when the user enters a new date, if by mistake he enters a date that has already been registered, and wants to save, the app does not leave it since there cannot be more than one record per date. My data is saved in an excel in one drive, so what the function should do is check in the date field of my excel and if the date that was entered and is going to be saved had been entered before, then no it should allow you to save the record. I hope my problem is better understood and in advance thank you very much for your time !!!

  • WarrenBelz Profile Picture
    156,409 Most Valuable Professional on at

    Hi @Labraham36 ,

    The code I supplied should do that - it is checking for a the existence of a record where you have the user's name in one field and the date selected by the user in another field. If this record exists, the message pops up and the date picker is cleared.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • Labraham36 Profile Picture
    95 on at

    Sorry it's so annoying lol, but for some reason it's not working for me. Attached image to see that I may be writing wrong. In my case I must replace the "," by the ";" since in my region it works like this. Also remove the part of the code: "UserField = User (). FullName &&" since there is no user validation in my App, the only thing I need to verify is if the date is repeated.

     

    Error 1.pngError 2.pngError 3.pngThanks!

  • Verified answer
    WarrenBelz Profile Picture
    156,409 Most Valuable Professional on at

    @Labraham36 ,

    YourDateField refers to the field name in your List, not the control name on the screen.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • WarrenBelz Profile Picture
    156,409 Most Valuable Professional on at

    Hi @Labraham36 ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard