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
Solved! Go to Solution.
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.
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"))
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
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.
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))
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"))
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
202 | |
71 | |
53 | |
49 | |
20 |
User | Count |
---|---|
256 | |
122 | |
83 | |
76 | |
75 |