Click last day

Hi huys. I have a question. I want the robot to filter on a website. He needs to select the last day of the month from the calendar that appears on the screen. However, this value can be variable (31,30,29,28). How can I click on the last day of the month in the calendar?

Hi @Ali_Osman_Kaya

You can try with this expression

Lastdate = (New DateTime(Today.AddMonths(1).Year,Today.AddMonths(1).Month,1)).AddDays(-1).toString("dd")

Pass this variable in the selector

1 Like

image

  1. In the selector many be you can find text or aaname or name in that you can pass this Lastdate variable to click dynamical for every month
1 Like

But my selector does not contain the month variable. I need to click on the largest number in the calendar. A small detail: february changes every 4 years

Hello @Ali_Osman_Kaya

  1. Open Browser activity: Navigate to the website with the calendar.

  2. Find Element activity:

    • Set the Selector property to target the calendar element on the website.
    • Set the Output property to a variable (e.g., selectedDateElement).
  3. Assign activity:

    • Create a variable (e.g., lastDay) to store the last day of the month (28, 29, 30, or 31). You can retrieve this value dynamically based on the current month and year.
  4. If activity:

    • Use a conditional statement to check the current month (e.g., using DateTime.Now) and assign the appropriate value to lastDay.
  5. Click activity:

    • Target: selectedDateElement
    • You may need to modify the selector or use a dynamic selector to specify the day in the calendar (e.g., “[lastDay]”).
  6. Close Browser activity: Close the browser when you’re done.

  7. End the workflow.

Thanks & Cheers!!!

1 Like

Hi @Ali_Osman_Kaya

May be can you share the calender screenshot.

Where did you select the month in the calender?

1 Like

Thank you but I found an idea. I will assign today’s date to a variable. This variable will only pull the month value. Then I will use the if activity.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.