cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Date Parsing in Trigger Condition

Hello,

 

I'm trying to have a flow run on an entity when it reaches a certain status and the dates entered are not the same date. I've set a trigger condition as:

 

 

 

@And(equals(triggerBody()?['e8s_currentstatus'], 713400004), not(equals(formatDateTime(convertTimeZone(triggerBody()?['actualstart'],'d', 'Eastern Standard Time', 'Eastern Standard Time'),'yyyy-MM-dd'), formatDateTime(convertTimeZone(triggerBody()?['actualend'],'d', 'Eastern Standard Time', 'Eastern Standard Time'),'yyyy-MM-dd'))))

 

 

  but the flow doesn't trigger. The date calculation is the problem, as only checking "currentstatus" triggers fine. Can a date comparison be done in the trigger?

5 REPLIES 5
Highlighted
Solution Specialist
Solution Specialist

Re: Date Parsing in Trigger Condition

Hi @eauerbach ,

 

Can you please elaborate more on what you are doing . Is it Case or Opportunity or some other entity. 

 

if it CDS entity : under filtering expression you should put your conditions like this 

triggerBody()?['e8s_currentstatus'] eq 713400004 and formatDateTime(convertTimeZone(triggerBody()?['actualstart'],'d', 'Eastern Standard Time', 'Eastern Standard Time'),'yyyy-MM-dd') ne formatDateTime(convertTimeZone(triggerBody()?['actualend'],'d', 'Eastern Standard Time', 'Eastern Standard Time'),'yyyy-MM-dd')

 

Thanks

 

 

Highlighted
Helper II
Helper II

Re: Date Parsing in Trigger Condition

Hi @ManishJain 

 

This is a custom CDS activity entity. There's some processing that needs to occur if actualstart and actualend are on different dates, so the trigger condition is meant to prevent the flow from running if the dates are the same. Will the attribute filters act the same as trigger condition and not start the flow when the conditions are not met?

Highlighted
Solution Specialist
Solution Specialist

Re: Date Parsing in Trigger Condition

Hi @eauerbach ,

 

Since you mentioned the flow is triggering when you use only optionset check I would suggest that you do use compose action for both start and end date . See to it if they both are coming same. Sometime it happens the conditions we put are not letting the flow to trigger even though the triggering attribute is correct. 

 

Thanks

Highlighted
Helper II
Helper II

Re: Date Parsing in Trigger Condition

Hi @ManishJain 

 

Appreciate the guidance, however, we took another tack. Instead of trying to parse the date in the trigger, I just added a second bool to prevent re-running. Be helpful if the trigger could be expanded a bit, but worked around it.

Highlighted
Solution Specialist
Solution Specialist

Re: Date Parsing in Trigger Condition

Hi @eauerbach ,

 

Glad you found a workaround for this issue. But It will be really helpful to give it a try for start date and end date. I understand you doing some work on other pieces but it will be worth once you find out what is wrong with dates. 

 

Thanks

Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (3,602)