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 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?
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
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 🚀
thank you @DeeDee , its returning us the first Friday of the month
Please find the power automate way of doing:
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 🚀
Hi @sudhakar_ypgr ,
You can use Run VBScript action to get Date First Friday of the month as shown in below.
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.
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.
(Note:- if you got your solution you can mark as solution and gives kudos)
Thanks & Regards
Vishnu Reddy
WarrenBelz
146,702
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,030
Most Valuable Professional