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 / Deny add items after s...
Power Apps
Answered

Deny add items after specific hour

(0) ShareShare
ReportReport
Posted on by 159

Hello

We have an app for adding food orders. Users add every day food orders. Orders must be taken everyday by 10 am . After this hour they cannot order and must receive an message when they try to add a new item.

It's that possible in PowerApps?

Thank you

 

 

Categories:
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    On your submit code write this:

     

    If(Hour(Now())>10,Notify("Order can not be placed after 10:00 A.M.",NotificationType.Error),"Your Submit Code")

     

    This code Hour(Now()) gives hour as number in 24 hour format. for eg. if it's 3 in the afternoon output will be 15. So, click on the submit button will first check if it's past 10 AM. if it is true it will display above message in the error form. If it is false it will add item

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

    Hi @ciprianpopovici,

    Have you solved your problem?

    Do you want to deny order after 10 am everyday?

    Could you please if there is need to re-trigger the order after 24:00?

     

    I agree with @zmansuri that you could use the Hour() function to get the hour number with 24 hour format. However, if you just want to deny order from 10:00 to 24:00 and re-order by 10:00 next day, I think you should add something different.

     

    If(
     Hour(Now()) > 10 && Hour(Now()) <= 24,
     Notify(
     "No order after 10:00 am!",
     Error
     ),
     Patch(
     Product,
     {Title: "NewItem"}
     )// Here replace with your Patch() formula
    )

    Hope this could help you at some degree.

  • ciprianpopovici Profile Picture
    159 on at

    hello, Sorry for my late response . Thank you for the support. I have  little modification on the formula , I try to find why not working, but no luck. So i need to block adding items if the hours is later than 10.30 AM. I have to use minutes also.  I use this formula , but all the time a have return false, even if hour it's 10.20 or 10.15... I adapt the formula in Excel and in Excel it's working. Can you give a clue?

     

    And(And(Hour(Now())>=10,Hour(Now()<11)),Minute(Now()<30))

  • Verified answer
    ciprianpopovici Profile Picture
    159 on at

    I think i managed to find a solution. The first formula was wrong.

    I add a new formula that seems to work in tests

     

    If(Hour(Now())<10,"OK hour",If(And(Hour(Now())=10,Minute(Now())<30),"OK Minute","NO"))

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard