Option #1: Using PAD Actions
- Paste the below code into a blank PAD editor and run the Flow
Display.SelectDateDialog.SelectDate Message: $'''Select date of current month''' DateDialogFormat: Display.DateDialogFormat.DateOnly IsTopMost: False SelectedDate=> SelectedDate ButtonPressed=> ButtonPressed
DateTime.Add DateTime: SelectedDate TimeToAdd: 1 TimeUnit: DateTime.TimeUnit.Months ResultedDate=> NextMonthDate
Text.ConvertDateTimeToText.FromCustomDateTime DateTime: NextMonthDate CustomFormat: $'''01/MM/yyyy''' Result=> FirstDateNextMonth
Text.ConvertTextToDateTime.ToDateTimeCustomFormat Text: FirstDateNextMonth CustomFormat: $'''dd/MM/yyyy''' DateTime=> FirstDateNextMonth
DateTime.Add DateTime: FirstDateNextMonth TimeToAdd: -1 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> LastDateOfMonth
Text.ConvertDateTimeToText.FromCustomDateTime DateTime: LastDateOfMonth CustomFormat: $'''dd/MM/yyyy''' Result=> LastDateOfMonth
Display.ShowMessageDialog.ShowMessage Message: LastDateOfMonth Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
- The Pseudo logic is:
- Take the Input Date eg; 28/07/2022
- Add 1 month to it - 28/08/2022
- Using the above date create the first date - 01/08/2022
- Subtract 1 day from the above date - 31/07/2022
- Final answer:31/07/2022
- Rest all are date formatting actions.
- This is how the process looks like if you select today's date

Option #2: Using vbscript
If you are looking for a 1 liner approach use vbscript

PAD code with Vbscript
Display.SelectDateDialog.SelectDate Message: $'''Select date of current month''' DateDialogFormat: Display.DateDialogFormat.DateOnly IsTopMost: False SelectedDate=> SelectedDate ButtonPressed=> ButtonPressed
Scripting.RunVBScript VBScriptCode: $'''varLastdate = DateSerial (%SelectedDate.Year%, %SelectedDate.Month + 1%, 0)
WScript.Echo varLastdate
''' ScriptOutput=> LastDate ScriptError=> ScriptError
Display.ShowMessageDialog.ShowMessage Message: $'''
The last date is: %LastDate%''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed