web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Expiry Date for Financ...
Power Automate
Answered

Expiry Date for Financial Year

(0) ShareShare
ReportReport
Posted on by 113

Hi @wskinnermctc, following my previous post I have a new scenario somehow bit more complicated as I need a date within the financial year ending 30/04 each year, anything submitted between 01/04 (current year) and  31/01 (following year) year will have the expiry in the following year (01/04/2023-31/01/2024 = 30/04/204, anything submitted after will have 1 year added (01/02/2024-31/03/2024 = 30/04/2025.

E.g. if the form is submitted on:

10/06/2023 - ExpiryDate will be 30/04/2024

30/09/2023 - ExpiryDate will be 30/04/2024

31/01/2024 - ExpiryDate will be 30/04/2024

05/02/2024 - ExpiryDate will be 30/04/2025

30/04/2024 - ExpiryDate will be 30/04/2025

 

Thanks,

Categories:
  • Luis Arellano Profile Picture
    247 on at

    Hello,

     

    One option could be the following.

     

    Compose action where you will split the date, assuming you have that in a variable called "date"

    split(variables('date'),'/')
    LuisArellano_2-1686979126043.png

     

     
    Then use the output and add a condition to check the month
    int(outputs('parsedDate')[1])
    LuisArellano_0-1686978979730.png

     

    Lastly create your ExpiryDate 

    LuisArellano_1-1686979033457.png

     

     

    If yes

    30/04/@{outputs('parsedDate')[2]}
     
    If no
    30/04/@{add(int(outputs('parsedDate')[2]),1)}
  • Chriddle Profile Picture
    8,729 Super User 2026 Season 2 on at

    I recommend always processing dates in ISO 8601, especially when used in calculations.

     

    Chriddle_0-1687171448902.png

    if(
    	greater(
    		item(),
    		concat(
    			split(item(),'-')[0],
    			'-01-31'
    		)
    	),
    	concat(
    		split(addToTime(item(),1,'Year'),'-')[0],
    		'-04-30'
    	),
    	concat(
    		split(item(),'-')[0],
    		'-04-30'
    	)
    )

     

    Result:

    [
     {
     "submitDate": "2023-06-10",
     "expiryDate": "2024-04-30"
     },
     {
     "submitDate": "2023-09-30",
     "expiryDate": "2024-04-30"
     },
     {
     "submitDate": "2024-01-31",
     "expiryDate": "2024-04-30"
     },
     {
     "submitDate": "2024-02-05",
     "expiryDate": "2025-04-30"
     },
     {
     "submitDate": "2024-04-30",
     "expiryDate": "2025-04-30"
     }
    ]
  • E9Mate Profile Picture
    113 on at

    Hi @Chriddle 

    Just trying to replicate your advise but I am failing as not very knowledgeable, could you guide me by steps as I am running it as a test platform, what type of Data Operations have you used for the SubmitDdates and ExpireDates.

    I have a manually triggered flow I am using to understand the process

    Screenshot 2023-06-26 095237.jpg

    Thanks for any help

     

  • Verified answer
    Chriddle Profile Picture
    8,729 Super User 2026 Season 2 on at

    SubmitDates is just a Compose action with an array of dates to check.

    ExpireDates is a Select action to process multiple dates without using a loop.

    It takes following:

    From: outputs('SubmitDates')

    Map:

    submitDate:  item()

    expiryDate: The code block above (if(...))

     

     

    If you only want to process one date item, you can just use the above code block in a Compose action and replace each item() with the date.

     

    Chriddle_0-1687793867487.png

     

     

    if(
    	greater(
    		triggerBody()['date'],
    		concat(
    			split(triggerBody()['date'],'-')[0],
    			'-01-31'
    		)
    	),
    	concat(
    		split(addToTime(triggerBody()['date'],1,'Year'),'-')[0],
    		'-04-30'
    	),
    	concat(
    		split(triggerBody()['date'],'-')[0],
    		'-04-30'
    	)
    )

     

     

  • E9Mate Profile Picture
    113 on at

    @Chriddle Thanks for the help, that has been working.

    However I have applied the concept to the flow which is collecting data from a Microsoft form. and replaced the 'triggerBody()['date']' with 'Get_response_details')?['body/submitDate']'

    if(greater(outputs('Get_response_details')?['body/submitDate'],concat(split(outputs('Get_response_details')?['body/submitDate'],'-')[0],'-01-31')),concat(split(addToTime(outputs('Get_response_details')?['body/submitDate'],1,'Year'),'-')[0],'-04-30'),concat(split(outputs('Get_response_details')?['body/submitDate'],'-')[0],'-04-30'))

    but I am not getting the correct result, e.g. the form submitted today 08th July I get:

    Capture.JPG

    Any thoughts?

    Thanks

  • E9Mate Profile Picture
    113 on at

    @Chriddle I have actually found the solution by initialising a variable set to string and formated the value to yyyy-MM-dd

    pic 1.JPG

    formatDateTime(outputs('Get_response_details')?['body/submitDate'],'yyyy-MM-dd')

    I then used Compose and your code

    pic 2.JPG

    if(greater(variables('ExpiryDate'),concat(split(variables('ExpiryDate'),'-')[0],'-01-31')),concat(split(addToTime(variables('ExpiryDate'),1,'Year'),'-')[0],'-04-30'),concat(split(variables('ExpiryDate'),'-')[0],'-04-30'))

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 263

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard