Filtering data table doesn't return expected results

Good afternoon, I’m building out an automation project for this one company and there’s a step where I want to filter a data table (generated from an Excel file read in in an earlier step) to KEEP rows where a certain field has a value that begins with a “1.”

Here is my filter wizard, I actually have 2 of these activities. One that keeps all the 1’s and 2’s from the data table. The same input table for both activities, but there are different output tables. I originally had another condition on there to keep rows where a different field has a value that IS NOT “I” but I removed it as a way to figure out why the tables aren’t filtering like they should.

This is what happens after the table is read in. After debugging a bit, I can confirm that the source file is read into a data table successfully and there’s 9 entries that start with a “1” and 7 that start with a “2.” The totalEntries variables are just the .Rows.Count

I’m kind of lost as to why these two filter activities aren’t filtering to the output tables like they should. I expect to see a table of 7 or 9 entries but get an empty table. The filter wizard is right because I’ve done something similar before where I keep rows containing a certain value, so I really don’t know where to look next. Can anyone assist?

Thank you.

Couple things you can check:

  • Make sure there are no whitespaces in the beginning of your cells in Excel. Sometimes they can be hard to see, but if the cell text begins with a whitespace, then the StartsWith filter will not work.
  • Make sure the data is stored as text in Excel. If the data is stored as a double in Excel, for example, 1.1, 1.2, 2.1, etc., then you may not be able to do a Starts With comparison. Try adding an apostrophe ' at beginning of the cell to force Excel to store it as string: '1.1.
1 Like