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 / Limit the number of it...
Power Apps
Answered

Limit the number of items entry per day

(0) ShareShare
ReportReport
Posted on by 159

I have a SharePoint list for programming gas fuel calendar. Users need to schedule when they need the card by pick a day from a date column. Look very simple but,  I need to set a condition that for every date the maximum entry is limited to 3 . with other words no more than 3 people can take a gas card per day.  For example :

 

Add one item for date first of the month. This date can be pick second time, third time, but when somebody wants to pick this date for the four time it will be block or receive some message to pick another day. Can this be achieved using PowerApps?

If you need further information please tell me.

Categories:
I have the same question (0)
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    You put a button to check weather the date is available or not, You can also put this code directly on submit button.

    Button OnClik

    Set(varCount,CountRows(Filter(ListName,DateColumn=DatePicker.SelectedDate)));

    This variable will compare user's selected date and compare it against your list entries. then find the matching entries and count rows. Let's say there are three entries matching to the selected date. 3 will be stored in varCount.

     

    Then next line:

    If(varCount>=3,Notify("Please Choose another Date",NotificationType.Error),Submit Code);

     

    This will check your variable if it is greater then or equal to 3 it will display error message if not it will submit your data.

  • ciprianpopovici Profile Picture
    159 on at

    Hello, Thank you. I will test and come back with feedback.

     

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @ciprianpopovici,

    Have you solved your problem?

    Do you want to validate the card booking to make it limit to 3?

    Could you please share a bit more about your scenario?

    I have a test on my side, please take a try as below.

    Set the OnSelect property as below:

    If(
     With(// I use With() to deal with the delegation warning messgae.
     {
     ds: Filter(
     Product, // Here replace with your data source name
     Date = DatePicker8_1.SelectedDate
     )
     },
     CountRows(ds)
     ) >= 3,
     Notify(
     "pick another day",
     NotificationType.Error
     ),
     SubmitForm(Form2) // Replace with your form name
    )

    Please check if this could help you at some degree.

     

  • ciprianpopovici Profile Picture
    159 on at

    Hello,

    Sorry for my late response. Today i tested the solution proposed by you and @zmansuri , and both are working fine. Both of you are great. Thanks.

     

    I will use your solution because  it's avoiding delegation so will accept as a solution.

     

    Thanks again.

  • ciprianpopovici Profile Picture
    159 on at

    Thanks for the  code provided. It's  working super fine.  I will use the code provided by @v-qiaqi-msft because avoid delegation warning.

    All the best.

  • MagnusGöransson Profile Picture
    424 on at

    Another way to get rid of delegation warnings is not to use CountRows. Just use Count instead.

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard