Datatable comparison error of data I get with get text activity

hello, I am getting data from a website as a string using the get text activity.


I’m scraping data from another website using data scraping, but I can’t compare the data I get with get text with the datatable.

does anyone know how to do this ? thanks.
Regards!

I will compare them in an if block and my robot will act accordingly. How can I do that?

Hi @Mert_Samet_Sonmez

what are you trying to perform? do you want to compare your payment amount that you retrieve with your get text with your datatable? or what should be your expected output

exactly as you said, I want to compare the payment amount in the datatable with the payment amount I received with get text. thanks

give a try with

(From d In dt.AsEnumerable
Where d("yourColumnName").ToString().Trim().ToUpper().Contains(yourGetTextValue)
Select r = d).CopyToDataTable

It will return the row with the value if it exist, if not will return an empty datatable

In this if block, I want to compare the data I get with get text with the data I scraped with data scraping and write it as approved or not approved on the page I sent accordingly.

If the output of the data I get with get text is “price”, the output of the data I get with data scraping is “DT1”, can you adapt them to the code, I could not do it exactly. thanks!

Hi @Mert_Samet_Sonmez, do you want to compare and check your ‘Get Text’ activity output with one by one value/ row in the DataTable?

(From d In DT1.AsEnumerable
Where d("Amount").ToString().Trim().ToUpper().Contains(price)
Select r = d).CopyToDataTable

i am getting error it says it is a boolean value

yes of course, I want this.

Hi @Mert_Samet_Sonmez,

This cannot be used in ‘If’ activity. You need to use ‘Assign’ activity assigning the output to variable of type Datatable.

Another way to do it is to loop through the DataTable row by row and checking the value from a specific column as below.


You can either compare the values by keeping them as strings or you can convert both of them to int or double.

T
ArcadiaFinanceChalllenge.zip (1.5 MB)
hanks ! Do you think there is an error in this process? I can’t try because the site is faulty, but I guess I did as you said and the error does not appear.

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