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

Date Testing

All,

 

So with the help of ,@v-yamao-msft, I have manged to get information on the leap years compose functions into flow, very helpful as per the below link.

 

Leap Years

 

The flow that uses the leap year compose functions is basically triggered on receipt of email from an initial flow that is sent requesting a new certificate.  As I cannot expect my supplier to rename the certificate file in a specific format I have decided to check if the email address of the incoming email matches that of one in a SharePoint list, this works fine.  I then need to test if the current expiry date is a leap year, and the rough and ready testing I have done works.  It then gets the attachment of the email and saves this to a specific location, which works to.  The basic flow looks like the below:

 

Leep Year 2.png 

 

The issue I have is physically doing the leap year testing in its true sense.  So, with a scenario of a current expiry of say 30/11/2018 this date is not a leap year, if I add 365 to that this is still not a leap year.  However, if you add another 365, this will be a leap year so writing that date to a SharePoint list will result in the date being 29/11/2020 and not 30/11/2020 as it should be.  So somehow, I need to have another compose action that maybe adds 365 days to the current expiry date and then test that against the other compose to determine it a leap year.

 

The next issue is I want to rename the suppliers certificate to something else, again the rough and ready testing I have done works.  I suppose again I need to use the compose action above as the date field of the filename but then change this to say a UK GMT region format.  I have done that before so that should not be a problem and have used the following:

 

convertTimeZone(utcnow(),'UTC','W. Europe Standard Time','dd MM yyyy')

 

But the issue I will have is incorperating the new date somehow in a an expression of some form of compose.  

 

So I need a little further helps please with the leap year side of things.  The above has to be acheiveable, I do not think I am expecting too much.

 

Regards,

 

Andrew

2 REPLIES 2
Community Support Team
Community Support Team

Re: Date Testing

Hi @WDRC,

 

I am afraid I have no way to see what the information provided in your screenshot is.

So I am not sure what your specific purpose is to determine if the date is a leap year.

What you mean is that the method to judge leap year is not working here, or you need more improvement to meet your Flow requirements.

If you are struggling to add 365 or 366, you could get the year of the next year and then use a similar method to determine if it is a leap year. If yes, add 366; if not, add 365

Please provide more details about your requirements, it seems that this post is only part of.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
WDRC
Level: Powered On

Re: Date Testing

Barry @v-bacao-msft,

 

I am moving this all to the below post:

 

https://powerusers.microsoft.com/t5/Building-Flows/Leap-Years/m-p/198223#M20606

 

 

This will be maked as an accepted solution when the above post has been resolved.  Sorry for cross posting never a good idea on this forum.

 

Regards,

 

Andrew

 

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us 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!

Top Kudoed Authors
Users Online
Currently online: 56 members 4,860 guests
Please welcome our newest community members: