How to dynamically pick the date from the below mentioned format

Hey @anjani_priya
Step 1: Get the last day of the previous month
Assign Activity:**

  • To: lastMonthEndDate (Variable of type DateTime)
  • Value:
New DateTime(Now.Year, Now.Month, 1).AddDays(-1)

Step 2: Adjust if it’s a Saturday or Sunday

Assign Activity:

  • To: adjustedDate (Variable of type DateTime)
  • Value:
If lastMonthEndDate.DayOfWeek = DayOfWeek.Saturday Then
    lastMonthEndDate.AddDays(-1)
ElseIf lastMonthEndDate.DayOfWeek = DayOfWeek.Sunday Then
    lastMonthEndDate.AddDays(-2)
Else
    lastMonthEndDate
End If

cheers