cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
WaleedBinAfzal
Level: Powered On

How to Subtract two dates and get the result in an integer to to compare with integer value?

Hi,

I have an entity in Microsoft Dynamics 365 CRM in which I have a submission date. What I want is to make an assistant card in Dynamics 365 CRM using Microsoft Flow that will be triggered before 7 days to the Submission date. 

I don't know how I can subtract two dates and get the result in an integer which I can compare with an integer value.

The condition will be something like this.

If((Submission Date - Current Date) <= 7 Days)

then show the assistant card,

Else do nothing.

 

I don't know how to achieve this in Microsoft Flow.

 

Any help or suggestion would be highly appreciable.

 

Thanks,

Waleed bin Afzal.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How to Subtract two dates and get the result in an integer to to compare with integer value?

Hi @WaleedBinAfzal , you need to have a couple of Compose controls, one to get today's date in the date format you want, and the second to calculate 7 days ago in the same date format. Then you have a Condition control: if SubmittedDate is greater than or equal to the output of 7 days ago AND Submitted date is less than or equal to the output of the Today compose then.....

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

 

1-Compose.png1-Compose controls and expression2-Condition.png2-Condition

1 REPLY 1
Super User
Super User

Re: How to Subtract two dates and get the result in an integer to to compare with integer value?

Hi @WaleedBinAfzal , you need to have a couple of Compose controls, one to get today's date in the date format you want, and the second to calculate 7 days ago in the same date format. Then you have a Condition control: if SubmittedDate is greater than or equal to the output of 7 days ago AND Submitted date is less than or equal to the output of the Today compose then.....

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

 

1-Compose.png1-Compose controls and expression2-Condition.png2-Condition

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 138 members 4,549 guests
Please welcome our newest community members: