Hi, all. I have a Flow that takes input from a form and creates a calendar event. But Microsoft Forms doesn't allow me to force the input of a time to be valid, and so my flow keeps breaking when my users input times as 0830 or 8:30 instead of 08:30. Right now all I have is to string together the date (from a date picker so that's always fine) plus the "T" plus the inputted time, plus a trailing ":00".
What I need is the logic to parse what they put in the "start time" and "end time" (short text) fields of the form to check if they forgot the colon or the leading zero to fix what they put in so I can hand it off to Convert Time Zone and continue my script from there.
I don't really know how to edit the raw code under Flows, so I need the instructions in steps that I can put into the Flow GUI editor. I could do this in python, but I have no idea how to do a nested series of IFs looking at string contents/substrings in Flow.
I'm picturing code that basically says (in old fashioned pseudocode style):
IF the string contains a colon AND is 5 characters long THEN its fine, continue
ELSE IF the string is 4 characters long:
IF the string contains a colon, THEN it must be missing the leading zero, so add it and continue
ELSE the string must be missing the colon THEN stick it in the third position and continue
ELSE (the string is neither 4 nor 5 characters long) THEN send an email to the user (I have their address from the form) telling them we failed to record this event
Alternatively, if there's just a way to do the python equivalent of "try" and catch IF the ConvertTimeZone is going to fail, just send that email warning them without trying to fix their bad input and make them resubmit the form, that would also be an acceptable outcome, if not quite as user-friendly.
I have a very small user group who I don't expect to do really stupid things like put in starting times that aren't times at all so I don't need to check for input like AB:CD, but they can sometimes make more reasonable input mistakes like I described above.
Thank you very much for any help you can provide!