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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / First Day of next Month
Power Automate
Unanswered

First Day of next Month

(0) ShareShare
ReportReport
Posted on by 12

Hallo

 

I have two Date fields the first one is the Date of the entry and the second one is the Due date of it.


I need a flow, which sets the due date always to te first day of the month

 

example

Date: 01. March 2019

Due: 01. April 2019

 

I tried it with add to time: 

 

2019-03-15 14_26_09-Edit your flow _ Microsoft Flow.png

 

But this dont work, because it adds 30 days. Result:

 

Date: 01. March 2019

Due: 04. April 2019

 

So how can i add exactly 1 Month with the same day?

 

Categories:
I have the same question (0)
  • Willemijn Profile Picture
    214 on at

    Hi!

     

    It's not adding 30 days, but Flow is confused about the date time format. 

    You could try this:  formatDateTime(triggerBody()?['Datum'],'yyyy-MM-dd')

     

    and then add 1 month, this should result in the correct date. 

  • v-bacao-msft Profile Picture
    on at

    Hi @wellisi ,

     

    You could use the following formula to get the last day of the month of Date of the entry:

    addDays(concat(add(int(formatDateTime(body('Get_item')?['Datum'], 'yyyy')),if(equals(formatDateTime(body('Get_item')?['Datum'], 'MM'), '12'), 1, 0) ),'-',add(int(formatDateTime(body('Get_item')?['Datum'], 'MM')),if(equals(formatDateTime(body('Get_item')?['Datum'], 'MM'), '12'), -11, 1) ),'-01T00:00:00Z'),-1)

    Note: You may need to replace body('Get_item')?['Datum'] when you test it, replacing it with the Dynamic content associated with "Date of the entry".

     

    Then use addDays() function to add one to the date of the last day to get the date of the first day of next month:

    addDays(outputs('Last_Day_of_the_Month'),1,'yyyy-MM-dd')

    Image reference:

    29.PNG30.PNG

    Please take a try and feel free let me know if you have any question.

     

    Best Regards,

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard