cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

ROUND Current Time down to nearest hour

Hello,

I have a Flow running every three hours which queries a REST endpoint for data then writes that data to an On-prem database. The Flow appears to take anywhere from 1-3 seconds to "fire". I'm worried that records might be missed if they are created during this 1-3 second window. 

 

Example Flow:

Trigger: Recurrance, every 3 hours, initiated at 2019-08-13T09:00:00Z

Action1: Get Current Time

Action2: Subtract Time, Current Time minus 3 hours

Action3: HTTP query to REST API, uses Action1 & Action2 outputs to query time range

 

Example Get Current Times for each run:

  • 2019-08-13T08:00:01.6592223Z.
  • 2019-08-13T11:00:01.0480805Z.
  • 2019-08-13T14:00:02.5570142Z.
  • 2019-08-13T05:00:00.8564303Z.
  • 2019-08-13T02:00:01.5099177Z.

How do I ROUND down the Get Current Time action to the nearest hour to protect against this?

 

Thank yoU!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Wow. This was actually VERY easy!!

I used the `startOfHour` function. Solution ended up looking like this:

Action1: Get Current Time

Action2: `startofhour('Get_Current_Time')`

Action3: Subtract Time, Action2 minus 3 hours

Action4: HTTP query to REST API, uses Action1 & Action2 outputs to query time range

 

Hope this helps others!

View solution in original post

1 REPLY 1
Super User
Super User

Wow. This was actually VERY easy!!

I used the `startOfHour` function. Solution ended up looking like this:

Action1: Get Current Time

Action2: `startofhour('Get_Current_Time')`

Action3: Subtract Time, Action2 minus 3 hours

Action4: HTTP query to REST API, uses Action1 & Action2 outputs to query time range

 

Hope this helps others!

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (15,230)