I need help with a flow. I am getting the time stamp from an email and I want to have Flow determine if its morning, afternoon, evening, afterhours and put that text in a cell on spreadsheet with other data. Example 2:05 PM should = Afternoon.
Time frame and Text to Place in spreadsheet
12:00 AM to 7:59 AM = "Afterhours"
8:00 AM to 11:59 AM = "Morning"
12:00 PM to 4:59 PM = "Afternoon"
5:00 PM to 10:00 PM = "Evening"
10:01 PM to 11:59 PM = "Afterhours"
I think I can do this with a condition but am at a loss.
Solved! Go to Solution.
I actually found my solution. @ScottShearer posted on another similar issue. However I needed to make the variable an type "integer" then it started working. Thank You Scott Shearer.
Hello @BrianHarmon
With 4 simple variable actions, you can get the needed period for your use.
Variable action 1: Name = Hour, Type = Integer, Value = expression sub(int(formatDateTime(utcNow(),'HH')),1)
This variable will hold a value from 0 to 23 from the datetime that you provide - I use utcNow() above - swap with your datetime field.
Variable action 2: Name = HourToPeriod, Type = Array, Value = [0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,2,3,3,3,3,3,0,0]
This variable holds an array of 24 numbers, where 0 represents Afterhours ... and so forth.
Variable action 3: Name = PeriodToText, Type = Array, Value = expression createArray('Afterhours','Morning','Afternoon','Evening')
This variable holds the names of the periods.
Variable action 4: Name = PeriodName, Type = String, Value = expression first(skip(variables('PeriodToText'),first(skip(variables('HourToPeriod'),variables('Hour')))))
This variable convert the Hours into a Period and then into the Name.
Kind regards, John
I actually found my solution. @ScottShearer posted on another similar issue. However I needed to make the variable an type "integer" then it started working. Thank You Scott Shearer.
Join digitally, March 2โ4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
User | Count |
---|---|
34 | |
16 | |
14 | |
8 | |
8 |
User | Count |
---|---|
33 | |
24 | |
17 | |
7 | |
6 |