Previous of previous week dates

Hello

How to get previous of previous week Friday to previous week Thursday date.
Example: Date format is (dd/MM/yyyy)
All dates from 03/02/2023 to 09/02/2023

image

I take invoice dates from web portal and store into the data base.
I have highlighted dates in the above image. Date consider as previous of previous week Friday to previous week Thursday date.

image

When I am run BOT in next Monday(20 Feb 2023) it will pickup all dates from 10/02/2023 to 16/02/2023

How to get that all dates?

Thanks
Minal Patil

@minal.patil ,
Check this workflow, it may help you
GetDatesBetween2Dates.xaml (6.5 KB)

It will get the error

For Each: Specified argument was out of the range of valid values. (Parameter ‘count’)

HI @minal.patil

Checkout this

To get previous of Previous week friday

Today.AddDays(14*Cint(Today.DayOfWeek<=DayOfWeek.Friday)+(DayOfWeek.Friday-Today.DayOfWeek)).ToString("dd/MM/yyyy")

To get last week thursday

Today.AddDays(7*Cint(Today.DayOfWeek<=DayOfWeek.Thursday)+(DayOfWeek.Thursday-Today.DayOfWeek)).ToString("dd/MM/yyyy")

To get all the dates you can check this steps

  • Assign list of string variable,
    ListOfDates = New List(Of String)
  • For Each Enumerable.Rage(0,7)
    • Append item to Collection and the item will be
Today.AddDays(14*Cint(Today.DayOfWeek<=DayOfWeek.Friday)+(DayOfWeek.Friday-Today.DayOfWeek)).AddDays(Cint(item.ToString)).ToString("dd/MM/yyyy")

Sequence1.xaml (16.6 KB)

Regards
Sudharsan

Regards
Sudharsan

It solve and how can I compare this all date to web portal invoice dates.

image

In web portal invoice dates are 03/02/2023,06/02/2023 to 09/02/2023.

Means 04/02/2023 and 05/02/2023 date are not available.

How can I compare and downloads this invoices.

Note:
Date is available between 03/02/2023 to 09/02/2023 in web portal then download the invoice.

So can you able to datascrap this data from website? @minal.patil

If yes do that and save them in a datatable

  • Counter =1
  • For each row in datatable and in the value field give the extractdatatable variable
    • If activity and the condition will be
      String.Join(",",ListofDates).Contains(CurrentRow("Invoice Date").ToString)
      • True → Click and use dynamic selectors with the attribute of idx there to click on the correct
        • ASSIGN Counter= Counter+1
      • Else → Leave it empty

You can check here for dynamic selectors

Regards
Sudharsan