Filter DataTable Activity

Hi, I build a process to scrap data from ecommerce site and store it in excel file then i use excel application scope to read data and add a column “Interested” then i want to filter that data and in filter datatable activity i use condition that Price > 16000 and i want to store “Yes” in Interested column. Any one help me that what is good way to do this?

Hi @Ahmad_Mubarak,

A similar question has been asked earlier today in the forums.
You could check this link for alternative ways to solve your issue. The link is related to null values but it is quite similar logic. In your case you have to modify the condition to a greater than or lower than type and provide a reference value to compare to.

How we can validate all data that is each rows has its values are present or null in excel file? - Build - UiPath Community Forum

If you don’t mind can you help me?

cc
ex
here is my excel file in which i want if price is greater than 16000 then in interested column “Yes” value stored if not then “No” value store

Hi @Ahmad_Mubarak

  1. Read excel but remember to Uncheck Preserve Format. This way the Currency format will not be imported and only number will be imported to UiPath. Store that in a InputDatatable

  2. Build a datatable with the required Columns

  3. Use a For Each Row in InputDatatable and use a IF condition.
    FilterTableWithoutPreserveFormating.zip (6.8 KB)

Alternatively since you will Uncheck the Preserve Format while reading the excel file, your filter screenshot will also work. That way you do not need to have interested column. It is your choice :slight_smile:

Hope this helps!

If: Conversion from string “Rs 93,500” to type ‘Integer’ is not valid. This error occurs

Did you uncheck PreserveFormat when reading the excel file?

If you did that already, then you can try this. Cint(row("Price").ToString.Replace({"Rs", ","},"").Trim)

It will remove the “Rs” and “,” and only leave 93500 for example which can then be converted to Cint.

2

Ok may be i was wrong on the syntax for multiple replace. You can try this.

Cint(row(“Price”).ToString.Replace(“Rs”,"").Replace(",", “”).Trim)

2 Likes

Thanks It work. but not write in excel file Interested column, it write in output panel

Hi @Ahmad_Mubarak

Just use a write range activity and use the output datatable. You will get a new excel file with Interested columns filled out.

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