Skip to main content

Notifications

Community site session details

Community site session details

Session Id : FCYWbykXT6D6pJX0p9Ntpv
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,324 Super User 2025 Season 1 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,105 Super User 2025 Season 1 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,105 Super User 2025 Season 1 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,324 Super User 2025 Season 1 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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Power Automate Desktop

#1
eetuRobo Profile Picture

eetuRobo 66 Super User 2025 Season 1

#2
Nived_Nambiar Profile Picture

Nived_Nambiar 18 Super User 2025 Season 1

#3
CU12050101-0 Profile Picture

CU12050101-0 12

Overall leaderboard