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 / Post a Word Doc templa...
Power Automate
Unanswered

Post a Word Doc template to Teams on a specific day of the month

(0) ShareShare
ReportReport
Posted on by

Hello all,

 

This one may be a bit complicated, or at least it seems that way to me.

 

I would like to be able to set up a flow that runs every month on the 1st. Its function would be to post a Word document template I have created to a Team doc library. 

 

I also need for the Word doc to be titled with a date, that date specifically being the last Friday of the month that the flow runs.

So, if it's running May 1st, the title would be the last Friday of May. If it's running June 1st, the title would be the last Friday of June, and so on.

 

If possible, I'd also like for a condition to catch if that last Friday falls on a holiday, in which case the doc would then need to be titled with the business day preceding the holiday. (This portion is not a big deal if too difficult/not possible, I can always go in and change the title manually when I notice a holiday coming up)

 

The purpose of this is to make sure that a new document is guaranteed to be posted on the Team and not rely on an individual creating it. I have a group that has reports due by the last Friday of every month, and being able to automate a fresh document for the current month would be awesome.

 

Thanks in advance!

Categories:
I have the same question (0)
  • AlexEncodian Profile Picture
    4,409 Moderator on at

    @Becca_Hayes 

     

    Its easily possible (up to the holiday identification which requires a bit more logic).

     

  • Becca_Hayes Profile Picture
    on at

    @AlexEncodian 

    Awesome to hear! Do you have a suggestion on how to accomplish this?

     

    Thanks!

  • AlexEncodian Profile Picture
    4,409 Moderator on at

    @Becca_Hayes 

     



    I can give you an idea but its best if you start building the solution and come here for troubleshooting

     

    Trigger: recurrence for first day of month

    Get file content: get word template

    Create file: create the file in the Teams doc

     

    You need to use an expression for the file name when creating it. 

    Add 1 month to current time utcnow() to get a day in the next month using "Add to time" action.

     

    To get lastdayofmonth = addDays(startOfMonth(body('Add_to_time')),-1)

     

    e.g. that would be 31st May 2024 if run today

     

    Get the dayofweek = dayOfWeek(outputs('Lastdayofmonth'))

     

    e.g. that would be 5 i.e. a Friday

    To get the days you have to take off that date i.e. 0 in May, the expression is:

     

    sub(sub(mul(7,div(add(outputs('Dayofweek'),2),7)),outputs('Dayofweek')),2)

    You can then use a "substract time" action to take this off the "lastdayofmonth" compose action and add that to the file name (formatted).

     

    Someone else might have a cleaner of doing it but this does it

     

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 274 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 175

#3
Haque Profile Picture

Haque 166

Last 30 days Overall leaderboard