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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Multiple Conditions in...
Power Automate
Answered

Multiple Conditions in a Flow (including date) from a List

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I have a simple flow that I want to trigger a chaser email if 2 criteria are met: 1) Status column = Pending / 2) Due Date column = today's date (this is a calculated field in the List). The Flow runs, however, doesn't generate any output when looking at the date. It works fine if the criteria is just 'Pending'. I think the issue may be around the date being pulled from the List and have tried using the 'formatDateTime' expression, but to no avail. 

 

Any suggestions would be very welcome. 

 

Thanks in advance,

 

Steve

SteveTaylor_0-1653919910178.png

 

 

Categories:
  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    The problem is that the DueDate and UTCNow() both contain a date and a time.  If the times don't match then they aren't equal.  If you add a formatDateTime() to each side and format them both as 'yyyy-MM-dd'. Then the condition will work.

  • SteveTaylor Profile Picture
    on at

    @Pstork1  Thanks for the quick reply.

     

    What would the expressions look like - I have tried the following but still learning expressions:

    Trigger: formatDateTime(triggerBody()'[duedate]', 'yyyy-MM-dd')

    Result: formatDateTime(utcNow(),'yyyy-MM-dd')

     

    The List shows the date with the format 'dd/mm/yyyy'

     

    Many thanks for your help,

     

    Steve

     

     

  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    It doesn't really matter which format you use as long as it is consistent on both sides of the condition.  The ones you've listed look correct.  You can also use 'dd/MM/yyyy' if you prefer.  The capital MM is important since 'mm' will pull in the minutes not he month.

  • SteveTaylor Profile Picture
    on at

    @Pstork1 Thanks for the reply. I've updated the expressions as suggested and it runs, but again, no output: 

     

    It runs fine when just looking at the Status column, but not when I introduce the Due Date. I have not seen this result where the flow runs, but not even showing 'false' results on the Conditions. Unsure what I am missing here?

     

    Thanks again for your ongoing help with this - much appreciated. 

    Steve

     

    SteveTaylor_0-1653922154941.png

     

  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    You said in your original post that due date was a calculated field.  Do you mean its calculated by SharePoint?  Or its calculated in the flow?  Add a compose before the condition at the top of the loop and check what actual values are being returned.  The greyed out Apply to Each would suggest that your Get items isn't getting any records.

  • SteveTaylor Profile Picture
    on at

    @Pstork1 I'll try adding the Compose in and see if that helps. In the meantime, if I select the date condition as the only parameter it gives the error message below - Is this pointing to the actual issue, ie the issue is the Sharepoint date being a calculated result rather than an inputted date?

     

    InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language function 'formatDateTime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'.

     

     

    The calculated result is within Sharepoint - pulls the date from another column and adds 21 days:

     

    SteveTaylor_0-1653923740247.png

     

    Thanks,

     

    Steve

     

     

     

     

     

  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    The Compose won't fix anything, but it will tell you what the values actually are that you are trying to compare.  The issue is the Due Date calculated field.  Calculated fields are usually unreliable in Power apps.  Add the compose and we'll see what value is actually coming in.

  • SteveTaylor Profile Picture
    on at

    @Pstork1 I think the data is pulling through ok from the List (copy of Compose input/output below). I changed the trigger field to a static input (1stChaser column) and it comes up with the same error message as above:

     

    SteveTaylor_1-1653924822891.png

     

    Interestingly, the calculated field result is actually showing 29 May, rather than 30 May on the List. Not sure if that is the root cause, however, as the same issue occurs with a manually input date.

     

    Thanks,

     

    Steve

  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    The May 29 vs 30 is because SharePoint displays it shifted for your time zone.  The May 29 is UTC.  I assume you are somewhere in North America.  This is a common thing. Flow always retrieves the actual stored value, which will be in UTC.  SharePoint retrieve the same value, but then converts it for the time zone of the site.  Midnight local time would be yesterday in UTC in North America.

     

    The problem in the condition is that you are using the wrong column name.  That's why its null.  Your post said you are using 

    formatDateTime(triggerBody()'[duedate]', 'yyyy-MM-dd')

    It should be

    formatDateTime(triggerBody()['Due_x0020_Date'], 'yyyy-MM-dd')
  • SteveTaylor Profile Picture
    on at

    @Pstork1 

     

    My timezone is UTC but it should show the same date?

     

    I updated the expressions to the below and got a slightly different error message: 

    Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language expression 'formatDateTime(triggerBody()['Due_x0020_Date'], 'yyyy-MM-dd')' cannot be evaluated because property 'Due_x0020_Date' cannot be selected. Please see https://aka.ms/logicexpressions for usage details.'.

     

     

    formatDateTime(triggerBody()['Due_x0020_Date'], 'yyyy-MM-dd')
    formatDateTime(utcNow(),'yyyy-MM-dd')
     
    Thanks,
     
    Steve

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 432

#2
11manish Profile Picture

11manish 313 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 154

Last 30 days Overall leaderboard