I have a Holiday Request Flow which the user fills out a Form > Admin Approve via Email > it then adds event to a Group Calendar but if the user only requests 1 day off I get the error below:
"Your request can't be completed. The duration of an event marked as All day must be at least 24 hours.
I think its creating the event for liek 00:01 to 23:59 or something along them lines so (I think) I need to add an hour or a few minutes onto the Form EndDate so its over 24 hours. However I cant work out how to link Dynamic Content + Expression like addHour(1). I cant find a way to get the code for the Form EndDate box to add into the expression.
Any pointers appreciated, screen below of the flow part that I'm struggling with:
Solved! Go to Solution.
Hello @newpauser
If you are creating an all day event, then you can ignore the end date.
Just make sure you have entered Yes in the Is All Day under the Advanced options.
In the Start time field, enter the expression "formatDateTime(<your start date column>,'yyyy-MM-dd')" - this will give you the date at midnight.
In the End time field, enter the expression "formatDateTime(addDays(<your start date column>,1),'yyyy-MM-dd')" - this will give you the next date at midnight.
The above works for me 🙂
Edited: If the event is for more than one day, then the last expression in the End time field must use <your end date column> instead of the <your start date column>!
Note that the reason that I am using formatDateTime is due to an All Day event must provide a Start time/End time that is at midnight, so I am just cutting off the time to do that 🙂
Kind regards, John
Hi @newpauser ,
Does your issue still exists?
You should refer to screenshot below to create the flow:
addHours(outputs('Compose'),1)
Best Regards,
Alice
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @newpauser
In your End Time:
In your expression addHours()
You want to do this:
addHours(<Your Dynamic Content>,1)
so in very simple terms,
Type your expression,
Click the dynamic tab,
Select your dynamic content with the End Time,
At the end of the expression put a comma ,
Than the amount of hours 1
Click OK
Proud to be a Flownaut!
See if you can use following functions AddToTime, SubtractFromTime...
Hello @newpauser
If you are creating an all day event, then you can ignore the end date.
Just make sure you have entered Yes in the Is All Day under the Advanced options.
In the Start time field, enter the expression "formatDateTime(<your start date column>,'yyyy-MM-dd')" - this will give you the date at midnight.
In the End time field, enter the expression "formatDateTime(addDays(<your start date column>,1),'yyyy-MM-dd')" - this will give you the next date at midnight.
The above works for me 🙂
Edited: If the event is for more than one day, then the last expression in the End time field must use <your end date column> instead of the <your start date column>!
Note that the reason that I am using formatDateTime is due to an All Day event must provide a Start time/End time that is at midnight, so I am just cutting off the time to do that 🙂
Kind regards, John
Hi @newpauser ,
Does your issue still exists?
You should refer to screenshot below to create the flow:
addHours(outputs('Compose'),1)
Best Regards,
Alice
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
thanks this worked as you mentioned with the edit part as I needed it to be either 1 full day or multiple.
Thanks everyone else who took the time to comment aswell!
User | Count |
---|---|
88 | |
39 | |
23 | |
20 | |
16 |
User | Count |
---|---|
128 | |
49 | |
46 | |
34 | |
25 |