How can i match with 2 values in pdf using uipath

Hi,

Currently I am using matches activity to match for 1 value. How can I use matches activity to match for 2 value at the same time in uipath?

I would like to get both payee name and account payable values but currently I am only able to get payee name value

this is my current flow:
image

Example:
image

Hi @anonymous3

In Matches Activity you can use another RegEx Expression

Hope it will helps you

Regards
Gokul

Hi I have tried but it doesn’t work, it doesn’t highlight in the test text

can anyone help? this is quite urgent. thank you very much. appreciated

Hi,

Can you try the following patern in Matches activity with Case Ignore.

"payee name (?<PayeeName>.*)\r?\n.*?account payable (?<AccountPayable>.*)"

We can get each value as the following.

Regards,

there is an error for the message box.

Hi,

Can you check TypeArgument property of For Each activity?
It should be System.Text.RegularExpressions.Match type.

Regards,

Hi I have changed the for each activity TypeArgument to System.Text.RegularExpressions.Match type and when I run the bot, nothing appears even tho there is a msg box

Hi,

Can you share original string data as a file? It’s no problem if dummy data.

Regards,

image

Hi,

Can you share it as txt file? We need exact data for regex expression.

Regards,

test.txt (355 Bytes)

Hi,

The keyword is not account payable but amount payable in the above txt file.
So i just modify it as the following.

Sample20210812-3.zip (3.0 KB)

"payee name (?<PayeeName>.*)\r?\n.*?amount payable (?<AmountPayable>.*)"

Regards,

same thing nothing appears

Hi,

Do you mean the above sample : Sample20210812-3.zip doesn’t work or other your code?

Regards,

thank you I have solved it. thankyou so much

1 Like

Hi I discovered a new problem. I used your code and I can’t extract the second payee name. Sometimes when the name is too long in the pdf, it will be on the next line.
test.txt (395 Bytes)

Hi,

Can you try to modify the regex pattern to the following?

"payee name(?<PayeeName>[\s\S]*?)\r?\n.*?amount payable (?<AmountPayable>.*)"

Then, add Trim method for payee name as the following.

item.Groups("PayeeName").Value.Trim

Regards,

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