How to verify get text value is equal to DataTable

Hi,
I wnt to check the get text values equals to the DataTable Value

Get the Text Value and Stored in “Text”
And Using Data Scrape Get the Data Table and Stored As (ExtractDataTable)
In If Condition,
ExtractDataTable.AsEnumerable().Any(Function (x) x(“Column1”).ToString = Text.ToString)
And set the Message Box True and Else False

If I Run this Is gave the False Message Box. But the Column Value is equal to the Get Text

Can U anyone clarifiy the doubt for me?

1 Like

@Rajiduraikannu_Santhosh_G

  1. Use Output DataTable activity and pass above output DataTable to convert it into string. Let’s say StrTableData

  2. And then check below condition in IF activity.

     StrTableData.ToLower.Trim.Contains(Text.ToLower.Trim)
    

The above expression will give True strength f value exists else False.

Hi,

you are using any method so expression will check the text output is matching any one of the row in the given column. Did you checked any value matching with the given text or check and spaces are there so that you can trim and compare. thanks.

Hi @lakshman,

I Try this method

But its also gave the False

@Rajiduraikannu_Santhosh_G

Use Get Text activity to get the value

Now check below to check whether the string value is in present in Datatable

Reference to check the value is present in DT column

Hope this will help you

Thanks

@Rajiduraikannu_Santhosh_G

Did you use Output DataTable activity to convert DataTable into String ? I can’t see Output DataTable activity in the above image.

1 Like

Hi

You are almost done

Hope the below steps would help you resolve this

  1. First gave the datatable variable named dt - the one extracted from data extraction

  2. Then use a output datatable activity and pass dt as input and get output as a string variable named Strinput

  3. Let’s take like you have get text variable named as strtext

  4. Now use a if activity with a condition like this

Strinput.ToString.ToUpper.Contains(Strtext.ToString.ToUpper.Trim)

If true it goes to then part or to else part

Cheers @Rajiduraikannu_Santhosh_G

1 Like

Hi @Srini84
I Try this Method. Its Working :+1:t4:

Regards,
Santhosh

1 Like

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