cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Darren137227
Frequent Visitor

Trigger flow with format date time expression

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User II
Super User II

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'))

View solution in original post

4 REPLIES 4
Expiscornovus
Super User II
Super User II

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'))

View solution in original post

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
Super User II
Super User II

Hi @Darren137227,

 

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

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.

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Users online (2,260)