# Extract latest date from webtable

**URL:** <https://forum.uipath.com/t/extract-latest-date-from-webtable/261653>\
**Category:** Academic Alliance\
**Tags:** uiautomation, activities\
**Created:** [October 12, 2020, 3:45pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653 "2020-10-12T15:45:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zara](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/zara/32/176634_2.png) [@Zara](https://forum.uipath.com/u/Zara)\
**Post date:** [October 12, 2020, 3:45pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/1 "2020-10-12T15:45:32Z")

</div>

Hi team,  
the webtable consist of a column link to download the form but there might be a possiblity that there are two links present so in that case BOT will be checking the date column and on the basis of highest/latest date will be clinking in the link column to download the form.  
Can anyone help to bulid this logic.

Thanks,  
Zara

---

<div class="post-metadata">

**Author:** ![NIVED\_NAMBIAR](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nived_nambiar/32/169066_2.png) [@NIVED\_NAMBIAR](https://forum.uipath.com/u/NIVED_NAMBIAR)\
**Post date:** [October 12, 2020, 4:01pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/2 "2020-10-12T16:01:21Z")

</div>

Hi @Zara

For this use webscrapping to scrape the entire webtable and then based on datatable manipulation check for latest date and corresponding to that date take the link use download that form which is present in datatable

Hope u got the logic what I had told

Regards

Nived N 🤖

Happy Automation 😌😌

---

<div class="post-metadata">

**Author:** ![Zara](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/zara/32/176634_2.png) [@Zara](https://forum.uipath.com/u/Zara)\
**Post date:** [October 12, 2020, 4:23pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/3 "2020-10-12T16:23:54Z")

</div>

can u please share the sample of logic?

---

<div class="post-metadata">

**Author:** ![NIVED\_NAMBIAR](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nived_nambiar/32/169066_2.png) [@NIVED\_NAMBIAR](https://forum.uipath.com/u/NIVED_NAMBIAR)\
**Post date:** [October 12, 2020, 4:25pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/4 "2020-10-12T16:25:32Z")

</div>

Can I have a weblink to show that demonstration? @Zara

---

<div class="post-metadata">

**Author:** ![Zara](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/zara/32/176634_2.png) [@Zara](https://forum.uipath.com/u/Zara)\
**Post date:** [October 12, 2020, 4:27pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/5 "2020-10-12T16:27:49Z")

</div>

apart from weblink…u can take any string and store it into variable…in real workflow i’ll replace it with click…  
that if more than one row is present in datatable then click in the column corresponding to highest date in the date column  
@c.ciprian can u pls help

---

<div class="post-metadata">

**Author:** ![NIVED\_NAMBIAR](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nived_nambiar/32/169066_2.png) [@NIVED\_NAMBIAR](https://forum.uipath.com/u/NIVED_NAMBIAR)\
**Post date:** [October 12, 2020, 4:34pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/6 "2020-10-12T16:34:39Z")

</div>

Can u Share the screenshot of webtable @Zara

---

<div class="post-metadata">

**Author:** ![ghazanfar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ghazanfar/32/175617_2.png) [@ghazanfar](https://forum.uipath.com/u/ghazanfar)\
**Post date:** [October 12, 2020, 5:11pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/7 "2020-10-12T17:11:56Z")

</div>

Hi Zara,

You have to perform following steps to achieve this.

1- Scrap the data of web page with data scraping activity including date column as well where all the dates are showing ok. It will give you data table.  
2- Now you need to add query on data table to find the latest date ok.  
[YourDataTableName].AsEnumerable().Max(Function (drRows) DateTime.Parse(drRows.Item(“DateColumnName”).ToString)).ToString  
3. It will give you the latest date then use “get attribute” activity and in the selector add that date and get table row. it will return table row.  
4. Pass that table row inside the click activity selector of ‘Download column’ of the table.

Just try it you can do it.

Hope it will work

---

<div class="post-metadata">

**Author:** ![Zara](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/zara/32/176634_2.png) [@Zara](https://forum.uipath.com/u/Zara)\
**Post date:** [October 12, 2020, 5:24pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/8 "2020-10-12T17:24:19Z")

</div>

hey…do u have any test xaml…that i can quickly integrate?  
i will make changes in the selector part…pls

---

<div class="post-metadata">

**Author:** ![ghazanfar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ghazanfar/32/175617_2.png) [@ghazanfar](https://forum.uipath.com/u/ghazanfar)\
**Post date:** [October 12, 2020, 5:27pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/9 "2020-10-12T17:27:11Z")

</div>

give me the url where you want to perform this.

I will create a work flow.

I did this in one use case but my workflow will not run on your laptop cuz data scraping will not work on your laptop/ pc because of selector issue and url also will not open, i am doing many things in it so share me url i will create workflow.

---

<div class="post-metadata">

**Author:** ![Zara](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/zara/32/176634_2.png) [@Zara](https://forum.uipath.com/u/Zara)\
**Post date:** [October 12, 2020, 5:28pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/10 "2020-10-12T17:28:40Z")

</div>

URL won’t open for u…  
U can share the workflow with activities …i will ammend into mine

---

<div class="post-metadata">

**Author:** ![ghazanfar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ghazanfar/32/175617_2.png) [@ghazanfar](https://forum.uipath.com/u/ghazanfar)\
**Post date:** [October 12, 2020, 5:29pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/11 "2020-10-12T17:29:18Z")

</div>

ook let me create a workflow.

---

<div class="post-metadata">

**Author:** ![Zara](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/zara/32/176634_2.png) [@Zara](https://forum.uipath.com/u/Zara)\
**Post date:** [October 12, 2020, 5:29pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/12 "2020-10-12T17:29:33Z")

</div>

please…thank you…

---

<div class="post-metadata">

**Author:** ![ghazanfar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ghazanfar/32/175617_2.png) [@ghazanfar](https://forum.uipath.com/u/ghazanfar)\
**Post date:** [October 12, 2020, 5:49pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/13 "2020-10-12T17:49:08Z")

</div>

I have added log messages indie the workflow it will help you to understand the code and you can make it dynamic according to your requirements .

Let me know in case of any issue[Downloading\_File\_With\_Latest\_Date.xaml](https://forum.uipath.com/uploads/short-url/7L8bznu63FbQYRxzgtfnUJ7jUcH.xaml) (11.4 KB)

---

<div class="post-metadata">

**Author:** ![Zara](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/zara/32/176634_2.png) [@Zara](https://forum.uipath.com/u/Zara)\
**Post date:** [October 12, 2020, 5:55pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/14 "2020-10-12T17:55:52Z")

</div>

will this work for date in the format “7/15/2020” ?

---

<div class="post-metadata">

**Author:** ![ghazanfar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ghazanfar/32/175617_2.png) [@ghazanfar](https://forum.uipath.com/u/ghazanfar)\
**Post date:** [October 12, 2020, 6:03pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/15 "2020-10-12T18:03:54Z")

</div>

You can set the date according to the format given on the web page.

Do you have skype? You can share your screen with me i will fix this  
ghazanfer.ali75

---

<div class="post-metadata">

**Author:** ![Zara](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/zara/32/176634_2.png) [@Zara](https://forum.uipath.com/u/Zara)\
**Post date:** [October 12, 2020, 6:06pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/16 "2020-10-12T18:06:00Z")

</div>

Uipath is throwing error because column name is “Date Submitted” and it is considering Date as a function in datacolumn because of which while passing the query it is throwing error “Date column” does not belong to table

---

<div class="post-metadata">

**Author:** ![ghazanfar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ghazanfar/32/175617_2.png) [@ghazanfar](https://forum.uipath.com/u/ghazanfar)\
**Post date:** [October 12, 2020, 6:07pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/17 "2020-10-12T18:07:06Z")

</div>

Because you are setting the name of the date column different in the scraping and in the query it is different.  
Make sure both are same

---

<div class="post-metadata">

**Author:** ![Zara](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/zara/32/176634_2.png) [@Zara](https://forum.uipath.com/u/Zara)\
**Post date:** [October 12, 2020, 6:08pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/18 "2020-10-12T18:08:00Z")

</div>

yeah i am giving Date Submitted only

---

<div class="post-metadata">

**Author:** ![ghazanfar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ghazanfar/32/175617_2.png) [@ghazanfar](https://forum.uipath.com/u/ghazanfar)\
**Post date:** [October 12, 2020, 6:08pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/19 "2020-10-12T18:08:41Z")

</div>

then write “Date Submitted” in the query as well in the column name

---

<div class="post-metadata">

**Author:** ![Zara](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/zara/32/176634_2.png) [@Zara](https://forum.uipath.com/u/Zara)\
**Post date:** [October 12, 2020, 6:13pm UTC](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653/20 "2020-10-12T18:13:47Z")

</div>

i just wrote query and try to fetch the result in log…but it is throwing error in the assign only…where i am passing the query

[Next page](https://forum.uipath.com/t/extract-latest-date-from-webtable/261653.md?page=2)
