Filter datatable not found value?

I use activity filter DataTable as below.

But after filter output not found that match with condition.

But If I use write range first —> read range —> filter activity have found condition.

Please guide me about it.

@fairymemay

Can you please print the DataTable row count below Filter DataTable activity and check whether it holds any data or not.

       DT_Detail.Rows.Count

@fairymemay

If it doesn’t give any output then we have two possibilities.

  1. DT_Input variable doesn’t hold any data or
  2. There are no rows matched with the specified condition in the given data.

@lakshman Now I use flow as below.

image

@lakshman My textfile as attched.
text.txt (855 Bytes)

@fairymemay

Is Generate DataTable activity generating DataTable properly ?

@lakshman

My flow as attached.
Main.xaml (8.4 KB)

From condition filter → output should 2 rows.
image

@lakshman Any idea for solve it ?

@fairymemay

Specify New Line separator as newline here. Did you enter any input data to see the preview ?

@lakshman Preview data as below.

@fairymemay

It looks good to me. Can you pass column index instead of Column Name into the Filter DataTable activity and check once.

Column Index will start from 0 onwards.

@lakshman How to pass column index?

@fairymemay

If you are filtering based on first column then pass 0 without double quotes.

@lakshman Output as same.

No data after filter.

@fairymemay

Please find the attached workfow for your reference.

Fairy_DataTableTask.zip (56.5 KB)

1 Like

@lakshman If I have file config for keep date for filter as below.

If filter column APADT (for filter from column Start_APAPDT and End_APAPDT) and filter APDODT (for filter Start_APDODT and End_APDODT)

  • Sometime file config have 1 row or more than 1 rows.
    config2.xlsx (8.9 KB)

Please guide me about it.

@lakshman Can you guide me more about it?

From your code

dtOutput = dtInput.AsEnumerable.Where(Function(row) Cint(row("APAPDT").ToString) > 25650101).CopyToDataTable

@fairymemay

The above expression is called Linq query.

Here, we are reading all rows from DataTable and and then converting APAPDT column value into String and checking whether its value is greater than 25650101. If rows found with matching criteria then it will assign all rows into dtOutput variable and it’s of type DataTable.

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