cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Greater or less than Current time

Hi,

 

How are you all?

 

I have a flow where I capture the current date time this is shown as:

 

"body": "2019-10-28T08:13:37.2080299Z"
 
I want to say as part of condition:
 
CurrentDateTime is >= 07:30:00 and CurrentDateTime is <= 09:00:00
 
Any ideas how I achieve this ?
 
Thanks in advance
6 REPLIES 6
Super User III
Super User III

Try the following

 

formatDateTime(utcNow(),'HHmmss'). This will give you an output without semi-colons.
 
Then compare this with  073000 & 090000
 


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials
Anonymous
Not applicable

Hey thanks for this, however the condition fails at the bottom of this screenshot.

 

"Unable to process template language expressions for action 'Condition_2' at line '1' and column '2770': 'The template language function 'less' expects two parameter of matching types. The function was invoked with values of type 'String' and 'Integer' that do not match.'."

 

The expression used is

 

formatDateTime(variables('Time'),'HHmmss')
 
flow.JPG

Could you use compose step instead of variable and try?



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials
Anonymous
Not applicable

So I have tried that, and still getting the same issueflow 2.JPG

Hi @Anonymous 

 

Could you please post your flow screenshot?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials
Anonymous
Not applicable

 

Hey,

 

I managed to sort this myself in the end, but thanks for your help ! flow.JPG

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (28,188)