Possible to filter row by number of character

Hi Expert.

I would like to filter out all this not a comment in the comments field. Some are not standard english words and it is not efficient to filter word 1 by 1 and it will end up 100 filter remove row condition in the uipath. I wonder if there is way to filter away the cell contain less than 5 characters?

Hi @Anneng

Please try this

dtTable - datatable

dtTable = dtTable.asenumerable.where(function(d) d(“comments”).tostring.length <5).copytodatatable



It doesn’t work, now i only left with rows that contain less than 5 characters. I want to remove them not keep them. I know what to keep comments that is meaningful. Should i use > 5 in the script instead of < 5?


Yes please use > 5

I’m sorry, it didn’t work in previous reply, what it does is, it sorted out the character <5 or >5 to be in the front rows. I tot is work but after i check the number of row with the source file, it look the same. It didn’t delete. let me add delete range and test it out. BRB

Thanks for your help. It works after i insert delete range.



I like to suggest other solution apart from provided by @prasath_S’s,
Use For Row activity and use activity to validate it.

  1. Create intIndex variable that property is of For each row activity
  2. provide intIndex to Insert/Delete row activty in position property, and also select Remove from Change mode property of same activity.

Thanks, i will try them out later.

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