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 / how to get first frida...
Power Automate
Unanswered

how to get first friday of the month in power automate desktop tool

(0) ShareShare
ReportReport
Posted on by 10


i am new to PAD ( power automate desktop), i am working on use case where i need to get the dates of all fridays in a month.So, can some one please help me on this?

I have the same question (0)
  • VishnuReddy1997 Profile Picture
    2,656 Super User 2026 Season 1 on at

    Hi @sudhakar_ypgr ,

     

    You can use Run VBScript action to get Date First Friday of  the month as shown in below.

    VishnuReddy1997_0-1716796183952.png

     

    Code:

    Please copy the below code to your flow.

     

    @@copilotGeneratedAction: 'True'
    Scripting.RunVBScript.RunVBScript VBScriptCode: $'''\' This code has been generated by AI. Original prompt:
    \' vbscript to get first friday of the month
    Dim dtmDate
    dtmDate = DateSerial(Year(Date), Month(Date), 1)
    
    Do Until Weekday(dtmDate) = 6
     dtmDate = DateAdd(\"d\", 1, dtmDate)
    Loop
    
    WScript.Echo dtmDate''' ScriptOutput=> FirstFriday ScriptError=> ScriptError

     

    Please find the solution To get all the fridays in amonth.

    VishnuReddy1997_1-1716796261514.png

     

    Code:

    @@copilotGeneratedAction: 'True'
    Scripting.RunVBScript.RunVBScript VBScriptCode: $'''\' This code has been generated by AI. Original prompt:
    \' Vbscript to get all the fridays in a month
    Dim dtmDate
    dtmDate = DateSerial(Year(Date), Month(Date), 1)
    
    Do Until Month(dtmDate) <> Month(Date)
     If Weekday(dtmDate) = 6 Then \' 6 = Friday
     WScript.Echo dtmDate
     End If
     dtmDate = DateAdd(\"d\", 1, dtmDate)
    Loop''' ScriptOutput=> AllFridays ScriptError=> ScriptError4

     

    If you new and if you dont know how to copy the code to your flow.

    Copy Paste Video.gif

     

    (Note:- if you got your solution you can mark as solution and gives kudos)


    Thanks & Regards

    Vishnu Reddy

     

     

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @sudhakar_ypgr 

     

    Please find the power automate way of doing:

    Deenuji_0-1716797174859.png

     

    Code:

    DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateAndTime CurrentDateTime=> CurrentDateTime
    SET Firstday TO $'''01/%CurrentDateTime.Month%/%CurrentDateTime.Year%'''
    Text.ConvertTextToDateTime.ToDateTime Text: Firstday DateTime=> FirstDayAsDateTime
    SET Day TO CurrentDateTime.DayOfWeek
    LOOP WHILE ($'''True''') = ($'''True''')
     IF FirstDayAsDateTime.DayOfWeek <> $'''Friday''' THEN
     DateTime.Add DateTime: FirstDayAsDateTime TimeToAdd: 1 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> FirstDayAsDateTime
     ELSE
     Display.ShowMessageDialog.ShowMessage Title: $'''Info''' Message: $'''The first Friday of the current month is: %FirstDayAsDateTime%''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
     EXIT LOOP
     END
    END

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • sudhakar_ypgr Profile Picture
    10 on at

    Thank you @VishnuReddy1997 

  • sudhakar_ypgr Profile Picture
    10 on at

    thank you @DeeDee , its returning us the first Friday of the month

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @sudhakar_ypgr 


    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

  • VishnuReddy1997 Profile Picture
    2,656 Super User 2026 Season 1 on at

    Hi @sudhakar_ypgr ,

     

    If it solved ,Please mark it as asolution,so it will help others in future.

     

    (Note:- if you got your solution you can mark as solution and gives kudos)


    Thanks & Regards

    Vishnu Reddy

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 711

#2
Vish WR Profile Picture

Vish WR 691

#3
Haque Profile Picture

Haque 525

Last 30 days Overall leaderboard