Extraction of fields which in different positions in the image

Hi all !
I have a use case which I am facing difficulties help me to solve!!!
I want to extract a field like Customer name in invoice image
For Example
Customer name : ajith Kumar
But challenge here is field will not be in same position in every images In some document it will be in top and it may in bottom are in middle of the paragraph…
If I’m using scrape relative feature whether it will work for this kind of field which in dynamic positions…
I need to find the word customer name in the document and then I have to scrape the respective data for the field…

Help me to solve this guys !!
Thanks in advance !!!

Hi @Chivo07, Welcome to the community.

Can you please give one sample image ?

Thanks,
Viswa.

for example I saved your post as InvoiceImage.png and processed to get the text.
You can now do string manipulations to extract what you want. The customer name can be anywhere in the image.

Hope this helps.

@Chivo07

Follow the steps mentioned by @viswanarahari to read image using OCR methods and store output in a string variable and say ‘getText’. And then apply string manipulation function to retrieve customer name like below:

getText.subString(getText.IndexOf(" Customer name : "+"Customer name : ".Length).split(Environment.NewLine.TocharArray)(0)

@lakshman
i have tried this one
throwing me an error!!
gettext is not member of string
gettext is not declared it may inaccessible due to protection level
help me to solve this issue

@viswanaraharieah
yeah!! i can understand upto this .
String manipulation is my issue
customer name : ajith kumar
i want only ajith kumar
how can i extract with string manipulation…!!!
share the workflows or share me a logic
please!!!
sh
g

@Chivo07

I already mentioned this. You have to read that image and store result in a String variable and say ‘getText’.

Hi @Chivo07.
Welcome to UiPath Community

  1. The output of Load Image should be of type String. Let’s say the String variable name is ‘getText’
  2. After, use this code shared by @lakshman:
  1. You may be getting the

error because (maybe) it is not declared properly or the scope of the variable is incorrect.

Yeah !!! That issue has been solved
Now error is strictly disallows implicit conversion from string to double

1 Like

@Chivo07

Could you please share your workflow and will check it and let you know.

As I mentioned in my work flow and variable list, all text is taken into textFromImage

Note : There was a small syntax typo from @lakshman

Can You try below ? I tested this before pasting it to you - FYI

textFromImage.subString(textFromImage.IndexOf(“Customer name :”)+(“Customer name :”.Length)).split(Environment.NewLine.TocharArray)(0)