web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / AddMinutes condition n...
Power Automate
Answered

AddMinutes condition not reading Converted Time

(0) ShareShare
ReportReport
Posted on by 41

Hello all!

 

I'm writing a Flow that scrapes an API for data that includes a timestamp. If the timestamp is within the last 30 minutes, the Flow should post a message as Flow bot to a Teams channel.

 

Time is displayed in the API as a 12-digit string in U.S. eastern time; I'm converting it to UTC in my Flow, which is testing successfully.

 

I then have a conditional: If converted time is greater than AddMinutes(utcNow(),-30), post the message to the Teams channel.

 

That conditional is not working. Even when the timestamp in the API is within the last 30 minutes, the conditional comes back as false. It never posts the message.

 

I've tried the conditional two ways; you can see that plus the output of converted time and how I'm converting time in the screenshots below.

 

Any guidance would be appreciated!

 

FLOW3.jpgFLOW2.jpgFLOW1.jpg

FLOW4.jpg

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    It should definately be the second way of doing it.  The parameter for UTCnow() is the format pattern you want, not the time.  In your first try you are feeding it the converted time, not a format pattern.  

     

    So the second set of code looks correct.  But could you show us an actual run of the flow with a compose to show the output of the time conversion and the addminutes() function?  That way we can see what is actually being compared.  That will probably identify why its not working.

  • eric-cheng Profile Picture
    5,171 on at

    Hi @ianhillmedia ,

     

    Please check to ensure the format of both dates are in the same format.  

     

    I am not in front of my pc but try formatting the utcnow() into the same format.

     

     

    As mentioned above, please post the data from your run.

  • ianhillmedia Profile Picture
    41 on at

    Sure! Any guidance would be appreciated. In this case I used AddMinutes(utcNow(),-90), just to make sure there was data from the API to capture. Screenshots below. Let me know if I can provide anything else that would help! FYI it's 12:30 p.m. ET, whichis 4:30 p.m. UTC right now. THANK YOU!

    FLOW3.jpgFLOW2.jpgFLOW1.jpg

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    That shows the converted time.  But can you also add a compose just before the condition and use the same AddMinutes() function as in the right side of the condition.  Then we can see what is actually being compared.  The converted time is in ISO 8601 format and the add minutes should default to that format as well, so I don't think formatting is the issue.  We need to make sure the AddMinutes is putting out the time you think it is.

  • ianhillmedia Profile Picture
    41 on at

    Done! So here's what I get when I Compose:

     

     

    addMinutes(utcNow(body('Convert_time_zone')),-90)

     

     

    Screen Shot 2021-07-11 at 1.12.01 PM.png

     

    I also Composed:

     

     

    addMinutes(utcNow(),-90)

     

     

     

    And got 

     

    2.png

    In both cases, the condition still returned...

    Screen Shot 2021-07-11 at 1.17.30 PM.png

     

    THANK YOU for your help!

  • eric-cheng Profile Picture
    5,171 on at

    Try this. Got it working in mine.  

     

    formatDateTime(addMinutes(utcNow(),-30),'yyyy-MM-dd HH:mm:ssZ')

     

    Screenshot_20210712-032046_Chrome.jpg

  • Pstork1 Profile Picture
    68,707 Most Valuable Professional on at

    Add a formatDateTime() function around the addminutes() to make sure its in same format as the adjust time zone.  Use this format.  'yyyy-MM-dd hh:mm:ssZ'

  • ianhillmedia Profile Picture
    41 on at

    No luck, unfortunately. 

     

    I used:

    formatDateTime(addMinutes(utcNow(),-60),'yyyy-MM-dd HH:mm:ssZ')

     

    Results below.

     

    Screen Shot 2021-07-11 at 6.14.30 PM.pngScreen Shot 2021-07-11 at 6.14.49 PM.png

  • ianhillmedia Profile Picture
    41 on at

    And here's a weird rub. This — expression less than Converted Time — always returns the condition as false, no matter what. It should return true when Converted Time is within 60 minutes.

    Screen Shot 2021-07-11 at 6.32.50 PM.png

     

    Meanwhile, this — expression greater than Converted Time — always returns as true, even when Converted Time is within 60 minutes and it should be false.

     

    Screen Shot 2021-07-11 at 6.33.05 PM.png

  • ianhillmedia Profile Picture
    41 on at

    Not having any luck, unfortunately. See below.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard