Filter DataTable by date and put it in a Excel-File

Hello Guys,

I am working with UiPath since one week and I am stuck at one point where I need to filter the data. My task is to extract data from a webpage and give the output (max. 1 week old) in an excel file. The thing is: the data needs to be filtered by date. The result should contain all the data extracted which is maximum 1 week old. I tried different solutions, but nothing really helped.

My Workflow looks like this:

https://ufile.io/mvhgrp88

It works, but I can’t figure out how i can filter the data. I tried the “Filter Data Table” activity, but it didn’t work. I hope someone can give me advise.

Thanks
Blerton

Hi @Blerton_Ismaili

Welcome to uipath community
you can use filer datatable activity in this case @Blerton_Ismaili

1 Like

@Palaniyappan Thanks for your answer but I already tried…
…unfortunately it didn’t work.

image

The date would be of string type thats why it didn’t work and we must change it to datetime type buddy @Blerton_Ismaili

May i know the date sample you have and its format
Cheers

2 Likes

@Palaniyappan

The Excel File looks like this:
image
The date format is: dd-MM-yyyy

@Blerton_Ismaili once you get the table output as datatable.use assign activity below it and in the value place give as let say the output datatable is “outputDT” now in value place give as outputDT.select("Date<’ give date as your wish’ ").copy to datatable and assign this value to to variable.you will get output as datatable. hope this helps you.

this can help you @Blerton_Ismaili, for sure

Kindly revert for any queries or clarification

Cheers @Blerton_Ismaili

@Palaniyappan @venkatmalla6

Can one of you guys have a look at my workflow… I tried it even with hardcoding the filtering date it does not work properly. Is there a possibility to make it flexible, so that it takes 1 week from today on?

ExtratByDate.xaml (14.7 KB)

@Blerton_Ismaili try to implement this in your xaml buddy
i tried with a sample of how to handle this
hope this would help you
Datefilter.zip (13.4 KB)

Kindly revert for any queries

Cheers

1 Like

@Blerton_Ismaili i just now gone through your xaml file. the output which i get from your is code is the date which is greather than 27/04/2019.and it gives me correct output.


this is output which i get once it filtered.

2 Likes

Buddy did that work for you with your sceanrio @Blerton_Ismaili

Hey Buddy, Sorry for the late answer. I didn’t had time. No, unfortunately it didn’t work…

Yeah, that’s the same output I get. But the entries from month 5 are missing? there should aso be some entries from May… Do you understand what I mean?

Could someone help me?

No worries @Blerton_Ismaili can i have that excel sample @Blerton_Ismaili
lets sort this out

Thanks guy! @Palaniyappan

The data in the excel comes from a webpage which is opened through my workflow. So basically there is no excel file. It is created in the end of the workflow. Have a look at my workflow.

ExtratByDate.xaml (16.0 KB)

@Palaniyappan I figured it out. Now it works. Now I tried doing the same workflow for another page. there it has an issue with the date do you know what the problem is here and how i can solve it.

image

This is the workflow…
ExtratByDate_SNB.xaml (14.4 KB)

It worked with the other “webpage” but not with this one. there is an issue with the date converting i thing.

1 Like

kindly send with project.json file also
all together a zipped one
Cheers…this can be resolved

@Blerton_Ismaili

Any issues buddy @Blerton_Ismaili

hi @Palaniyappan, how i write command condition is today and today-7. please help me!