How to read column data according to current month

I have excel data containing schedule dates for every month for 2023, i should run BOT on 1st of every month ,it should read data according to current month.

attaching image for sample excel data i have:
image

Hello @rajthyaga53

you can get the current month using below code
currentMonth = Now.ToString(“MMMM”).ToUpper

and then within For each datatable you can read the required column data using
currentRow(currentMonth).ToString

Hi @rajthyaga53

You can try like this

  • Read and store in Datatable.
  • For each row in datatable
    • CurrentRow(Now.Tostring(“MMMM”).ToUpper).Tostring will get you the data from jan when you run the bot on 1st jan.

Regards
Sudharsan

@rajthyaga53
Use this
var= Now.ToString(“MMMM”).ToUpper

then you can use “for each row in data table” activity
i)currentRow(var).ToString

Hi @rajthyaga53

To read column data according to the current month in UiPath, you can use a combination of the Read Range activity and the Filter Data Table activity. Here’s an example of how you can do this:

  1. First, use the Read Range activity to read the data from the Excel file into a data table.
  2. Next, use the Filter Data Table activity to filter the data table based on the month column. To do this, set the Filter property of the Filter Data Table activity to a condition that selects only the rows with the current month in the month column.

Thanks!!!

1 Like

You already have the explanations, I would like to add that there’s an activity “Modify Date”. This activity can be pretty helpful for anyone not too familiar with Date Manipulation in VB.

Looks like this: :slight_smile:

image

1 Like

Hi guys, thanks for help, it worked, but when i send mail using that data its in different format , i just want dd-mm-yyyy
image

can anyone tell what changes i can make

thank you