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 form submissions...
Power Apps
Answered

Limit form submissions to 3 times a week

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi there!

 

I'm currently creating a form that only allows each person to make reservations for a maximum of 3 times a week. So if one already have 3 reservations in the same week recorded on my sharepoint list, then when the person make the 4th reservation on the same week, an error message will be shown on my canvas app. Can anyone assist me in my code, it doesn't seem to be working:

 

If(CountIf(SharepointList,ReservedBy=DataCardValue4.Text && DateValue(Text(ReservedDateinSharepointList,DateTimeFormat.LongDate))>=DateValue(Text(DateAdd(DataCardValue5.SelectedDate,1-(Weekday(DataCardValue5.SelectedDate,Monday)),Days),DateTimeFormat.LongDate)) && DateValue(Text(ReservedDateinSharepointList,DateTimeFormat.LongDate)) <= DateValue(Text(DateAdd(DataCardValue5.SelectedDate,7-Weekday(DataCardValue5.SelectedDate,Monday),Days),DateTimeFormat.LongDate)))>3,"You can only make 3 bookings per week.","")

Categories:
I have the same question (0)
  • Verified answer
    Ashwin7104 Profile Picture
    671 on at

    Hey @Anonymous ,

     

    I used WeekNum function in PowerApps to try to get your result. Let us know if it works for you. 

    https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/functions/function-weeknum

     

    ClearCollect(FilteredTablebyCurrentUserWeek,Filter(ClearCollect(FilteredTablebyCurrentUser,Filter(SharepointList, 'Created By'.Email = User().Email)),WeekNum(Created) = WeekNum(Today())));

    Storing it in Collections to avoid delegation issues.

     

    If(CountRows(FilteredTablebyCurrentUserWeek) = 3,"You can only make 3 bookings per week.")

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Ashwin7104 , 

     

    Thanks for your help, WeekNum function worked for me! I'm not familiar with Collections, so I have created a column on my Sharepoint List to collect the Week Number information.

     

    If(CountRows(Filter(SharepointList,ReservedFor=DataCardValue4.Text,WeekNumber=WeekNum(DataCardValue5.SelectedDate,Monday)))=3,"You can only make 3 bookings per week.","")

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

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard