cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Re: ROUND Current Time down to nearest hour

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!

1 REPLY 1
Super User
Super User

Re: ROUND Current Time down to nearest hour

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!

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 130 members 4,653 guests
Please welcome our newest community members: