How to put Screen Scraping OCR - output of PaneDatapanel value in IF statement


I did a small screen scraping and result is stored in output (PaneDatapanel) variable.
The value of Variable is both text and number.
Like: In Total: 125,50

How can i use this Initiger value 125,25 in a IF statement?

kindly help.

1 Like

Use this expression in a assign activity like this

Int_value = Convert.ToInt32(System.Text.RegularExpressions.Regex.Match(str_input.ToString,”\d.+\W.+\d”))

Now this int_value variable of type int32 can be used where we want

Cheers @Latif

It’s not working :frowning: check

1 Like

Pls type from your side as sometimes while copying the double quotes will get changed
Cheers @Latif

Kindly re type and let know for any queries or clarification
Cheers @Latif

I typed all and how getting this error.

I need to understand that I did right…
Int_value is a new variable in assign right?

But where I will use the (PaneDatapanel) variable which have the result of screen scrap? As I want to convert that so I can use number value to evaluate in if statement.

1 Like

Fine I got it the issue is with the type conversion
Kindly include a .ToString and also , been used along the numbers
Like this
Int_value = Convert.ToInt(System.Text.RegularExpressions.Regex.Match(str_input.ToString,”\d.+\W.+\d”).ToString.Replace(β€œ,”,””))

Cheers @Latif


when i run it … getting this error


1 Like

here you go with an xaml with same expressions (9.2 KB)
Cheers @Latif

it still give same error :frowning_face:

hmm…its working fine for me buddy

no worries
kindly share your xaml if possilble

Cheers @Latif

ScrapInterestDebtValue - Kopi.xaml (23.2 KB)

Maybe its not working because im getting a value both in minut and in plus…

Like: In Total: -658,80
or Like : In Total: 125.50

1 Like

So in that case we need to replace that - as well right
Int_value = Convert.ToInt(System.Text.RegularExpressions.Regex.Match(str_input.ToString,”\d.+\W.+\d”).ToString.Replace(β€œ,”,””).Replace(β€œ-β€œ,””).Trim)

Cheers @Latif

here is picture of screen scrap value.
but value can be this also

It gives same error

I need to put that if after scrap the value is 0 then it has to follow step from True side or if its not 0 then follow step form wrong side.

Here you go with a xaml (9.6 KB)

it worked
kindly try with your scenario and let know for any queries or clarification
and have handled this as well

Cheers @Latif

1 Like

Thanks Palaniyappan. Its working now :).
A big thanks You are a Master ***** . This is Star from me :).

1 Like

Cheers @Latif

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