Skip to main content
Community site session details

Community site session details

Session Id : 2u/CAD9IC56HgDqlHGXEzX
Power Automate - Power Automate Desktop
Unanswered

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

Like (0) ShareShare
ReportReport
Posted on 27 May 2024 07:41:39 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?

  • VishnuReddy1997 Profile Picture
    2,526 Super User 2025 Season 2 on 27 May 2024 at 08:28:55
    Re: how to get first friday of the month in power automate desktop tool

    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

  • Deenuji_Loganathan_ Profile Picture
    6,204 Super User 2025 Season 2 on 27 May 2024 at 08:24:12
    Re: how to get first friday of the month in power automate desktop tool

    @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 🚀

  • sudhakar_ypgr Profile Picture
    10 on 27 May 2024 at 08:21:38
    Re: how to get first friday of the month in power automate desktop tool

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

  • sudhakar_ypgr Profile Picture
    10 on 27 May 2024 at 08:20:51
    Re: how to get first friday of the month in power automate desktop tool

    Thank you @VishnuReddy1997 

  • Deenuji_Loganathan_ Profile Picture
    6,204 Super User 2025 Season 2 on 27 May 2024 at 08:06:53
    Re: how to get first friday of the month in power automate desktop tool

    @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 🚀

  • VishnuReddy1997 Profile Picture
    2,526 Super User 2025 Season 2 on 27 May 2024 at 07:54:53
    Re: how to get first friday of the month in power automate desktop tool

    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

     

     

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete