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 / Trigger flow with form...
Power Automate
Unanswered

Trigger flow with format date time expression

(0) ShareShare
ReportReport
Posted on by

Hi, I am trying to trigger a flow comparing the SP modified field against another date time field called CUOSignOffDt.

I only want to compare down to format dd/MM/yyyy hh:mm format.

 

I have managed to successfully add a condition at the beginning of the workflow comparing the two fields using the format date time expression and this works fine. However, ideally I don't want the flow to trigger, so need to do the comparison in the 'When an item is created or modified' trigger action as a Conditional trigger. To note the 'When an item is created or modified' trigger action is using a gateway connection to an on prem version of SP so can't use the 'Get changes for an item or a file action'

I need to compare the two date time fields, making sure they are the same down to dd/MM/yyyyy hh:mm format in a trigger condition in the 'When an item is created or modified' trigger action. 
I tried various syntax options, along the lines of, but saying incorrect syntax:

@

@equals(triggerBody()?formatDateTime(['Modified'], 'dd/MM/yyyy hh:mm')?['value'],formatDateTime(['CUOSignDt'], 'dd/MM/yyyy hh:mm'))

 

Any help would be highly appreciated.

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @Darren137227,

     

    Can you try and use this expression:

    @equals(formatdatetime(triggerOutputs()?['body/Modified'], 'dd/MM/yyyy hh:mm'), formatdatetime(triggerOutputs()?['body/CUOSignOffDt'], 'dd/MM/yyyy hh:mm'))
  • Darren137227 Profile Picture
    on at

    Hi Expiscornovus,

    the syntax was successfully accepted but got this message when triggered....

     

    Darren137227_0-1620902460798.png

     

    The template language function 'formatdatetime' expects its first parameter to be of type string. The provided value is of type 'Null'



  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    Hi @Darren137227,

     

    Is the CUOSignOffDt field by any chance empty in that test?

  • Darren137227 Profile Picture
    on at

    Hi Expiscornovus , it wasn't empty, it was me supplying the wrong name, it's actually called 'CUOSignDt' -  doh!

    Works a treat!! Thanks a million.

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard