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 / How do i restrict an i...
Power Apps
Unanswered

How do i restrict an input?

(0) ShareShare
ReportReport
Posted on by 57

i add a data with user infos into a gallery. How do I implement that you could only insert each date once, so that no duplicates are inserted?

I add the following to my gallery by a patch function:

Admir0110_0-1709626611188.png

This is the Data Source:

Admir0110_1-1709626631278.png

And this is the Code of the Gallery:

Admir0110_2-1709626658106.png

 

 

Categories:
I have the same question (0)
  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    hey @Admir0110 

     

    please copy/paste your patch code here so we do not need to retype

     

     

    thanks in advance

  • Admir0110 Profile Picture
    57 on at
    If(
     DatePicker1.SelectedDate < Today()+1,
     Reset(DatePicker1);
     Navigate(Fail_Screen);
     Notify("Fehlgeschlagen! Bitte wählen Sie ein Datum ab morgen", NotificationType.Error),
     Patch(
     Tabelle1,
     Defaults(Tabelle1),
     {
     Datum: DatePicker1.SelectedDate+1,
     Email1: User().Email,
     Name: User().FullName
     }
     ) ;
     Reset(DatePicker1);
    Navigate(ThankYou_Screen, ScreenTransition.Fade);
    Notify("Erfolgreich!", NotificationType.Success);
    Reset(Gallery1));
    Refresh(Tabelle1)
  • NPPlatform Profile Picture
    606 Moderator on at

    Hi @Admir0110 , I see you Patch 'DatePicker1.SelectedDate + 1' as a date. If you want to check whether there already is a row in the datasource with this date you could use a formula like

     

    IsBlank(LookUp(Tabelle1, Datum =DatePicker1.SelectedDate + 1)) 

     

    If  this resolves to true, there is no row found for that date. If it resolves to false, there is a row found. You can put this check in your patch-statement and build a similar structure to the error (for when somebody selects a date before tomorrow) you already have.

  • Admir0110 Profile Picture
    57 on at

    Thanks for the reply unfortunatly i get the following error message:

    Admir0110_0-1709628479749.png

     

  • Admir0110 Profile Picture
    57 on at

    Did i implement it the right way?

    If(
     Or(DatePicker1.SelectedDate < Today()+1,IsBlank(LookUp(Tabelle1, Datum =DatePicker1.SelectedDate + 1)) ),
     Reset(DatePicker1);
     Navigate(Fail_Screen);
     Notify("Fehlgeschlagen! Bitte wählen Sie ein Datum ab morgen", NotificationType.Error),
     Patch(
     Tabelle1,
     Defaults(Tabelle1),
     {
     Datum: DatePicker1.SelectedDate+1,
     Email1: User().Email,
     Name: User().FullName
     }
     ) ;
     Reset(DatePicker1);
    Navigate(ThankYou_Screen, ScreenTransition.Fade);
    Notify("Erfolgreich!", NotificationType.Success);
    Reset(Gallery1));
    Refresh(Tabelle1)

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 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard