Forum Discussion
William Mattison
Sep 20, 2016Brass Contributor
Forms: Time input question
In Office 365 Forms, I am attempting to create an event request form. I do not appear to be able to add a question for TIME of Day. I see a template for DATE but not TIME. In Google Forms "include...
Ray_Etscheid
Mar 03, 2023Copper Contributor
It's insane that this has been requested since 2016 and still no time field.
MSUM_Clifferton
Mar 09, 2023Brass Contributor
Here's a quick description of how I've worked around this problem. I'll try to do a write up and share here soon.
I built a fairly complicated flow in Power Automate to parse the different ways in which I was seeing folks submitting times. I'm certain there are easier and more efficient ways to do it, but I just made it work with the knowledge and skill I had at the time.
I asked people to submit times in the format hh:mm am/pm. some do most do not.
- I check to see if the time submitted is the word "noon" and set a variable accordingly if so. If not...
- I check to see whether the submitted time contains a colon, indicating it is formatted "properly". if so, i split the time at the colon and Set variables for hour and minutes accordingly. If not...
- If no colon in the submitted start time, I guess that only a 1 or 2 digit number was entered "2 pm" for instance. I don't suspect anyone will put "230 pm" when they mean "2:30 pm". So i loop through the characters in the string one by one extracting only the numbers. then set that number as the hours and set the minutes to "00"
- Next, I check to see whether the hours variable is equal to "12". If so I do nothing. If not...
- I check to see whether the submitted time contains a "p" or a "P" indicating the time is in the afternoon. If so, I add 12 to the hours variable to obtain a 24 hour time. If not, I do nothing.
- Then I format a string in whatever format is needed to create the event or submit to sharepoint or whatever it is i'm doing with that date. Often that is UTC. if so I do a time conversion.
I'll give more details and potentially share a flow as soon as I can.