Selection of a date/text based on different text

Hi all,
I want to extract date from the following context:

Name: John Doe
License Type: Registered Nurse
Expiry Date: 01/05/2015

Name: John Doe
License Type: Technician
Expiry Date: 02/06/2018

I want the expiry date 02/06/2018 to be extracted if John Doe is a Technician, or if the License type is a Registered nurse, I want 01/05/2015 to be extracted. I tried using Anchor base, with Find Element (License type) and Get Text activity (Expiry Date)- with no results
(More than 1 licenses can be applicable for the same person)

As 1 person can hold multiple licenses, I want the expiry date to be extracted that is specific to the license type like a nurse or a technician. Also all the licenses appear one below other.
The expiry date to be obtained is dependent on the license type. As 1 person can hold multiple licenses, I want the expiry date to be extracted that is specific to the license type like a nurse or a technician. Also all the licenses appear one below other.

Thanks

Hello.

In my opinion the best way is:

  1. Extract the license name and type.
  2. Make an If where you validate: name = John Doe OR License type = Nurse, extract data.

Hug

@Juhi_Patil Try attached workflow

Example.zip (3.5 KB)

Output

Capture

May we ask you the share with us some more context on the source from where you take the text. It would help us to fine tune the solution strategy.

In general we can think on:

  • splitting the text on lines, filtering, Regex Pattern matching
  • Regex Selector

Hi @Juhi_Patil,

value = "Name: John Doe
License Type: Registered Nurse
Expiry Date: 01/05/2015"

valueArray = value.Split(Environment.NewLine().ToArray,StringSplitOptions.RemoveEmptyEntries)
name = valueArray(0).Split(":"c)(1).TrimStart.TrimEnd
licenseType = valueArray(1).Split(":"c)(1).TrimStart.TrimEnd
expiryDate = valueArray(2).Split(":"c)(1).TrimStart.TrimEnd

If you share more detailed examples, different solutions can be applied.

Regards,
MY