How to filter the scrapped data?

Hello All,

I have scrapped the datatable dtTable, it contains 10 rows, I need to check whether a queue item is present with in that 10 records, if find I need to mention as present, if none of the rows contains the queue item than I need to mention as “queue item not found”

Kindly help on this

Hi @naveen.s

Can you try this

queueItem = "YourQueueItem"
found = (From row In dtTable.AsEnumerable()
         Where row.ItemArray.Any(Function(c) c.ToString.Contains(queueItem))
         Select row).Any()

If found
    message = "Present"
Else
    message = "Queue item not found"

Regards,

Can you please tell using for each and if condition activity??

@naveen.s

queueItem = "YourQueueItem"
found = False       DataType:Boolean
For Each Row in DataTable activity
    If row("ColumnName").ToString.Contains(queueItem)
        found = True
        Break activity


If found
    message = "Present"
Else
    message = "Queue item not found"

Regards,

Hey @naveen.s

Use below mentioned LinQ:

isItemFound = dt_Input.AsEnumerable().Any(Function(row) row("YourColumnName").ToString.Trim.Equals(QueueItem.SpecificContent("YourKey").ToString))

Note: isItemFound is a Boolean Variable.

If the value Is available then boolean variable will be True else False.

Best regards,
Ajay Mishra