Fetch value from column of Excel

activities
studio

#1

Hi ,

I have a situation where i need to fetch value from a particular column[Document Date].
image

Date can be anywhere in Document Date Column , i need to just fetch date value.

Can you guide me how can i achieve this?

Thanks,
Ahtesham


#2

Hi @md.ahtesham,

There must be so many ways to achieve this. You can try the distinct method to get the value:
dateValue = dt_Test.DefaultView.ToTable(true,“Document Date”).Rows(1).Item(“Document Date”).ToString


#3
  • Use Filter Datatable activity.
  • In filter give [Document Date] not equals “”
  • In columns tab give [Document Date].

#4

Thank you . Both of the solution worked.


#5

Sorry to disturb you again… How we can fetch the first date if situation is like below.

image

FYI … date will be same . there is no chance that there will be different date. just the thing is it can be anywhere and any number of times.

Thanks,
Ahtesham


#6

Hi @md.ahtesham,
Above solution (@PD2 provided) will gives the first value from your DocumentDate column. It depends on row index, If you change the Row index it will gives the according value for that index.

dateValue = dt_Test.DefaultView.ToTable(true,“Document Date”).Rows(1).Item(“Document Date”).ToString ----------> First value

dateValue = dt_Test.DefaultView.ToTable(true,“Document Date”).Rows(2).Item(“Document Date”).ToString ----------> Second value

Thanks!


#7

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