If condition to pick Emplid from excel

Hi Team ,
Good day …!!
we have one excel sheet, In that we need to find employee ID which combination of 5 alphanumeric only.(e.g. YYY45, 45IUY,46YYY).

How to write in IF condition to for below scenarios .

  1. Need to find valid Emplid with 5 alphanumeric only in excel column and pass in .
  2. Emplid will come along with comment in starting or in ending of the sentence , we need to pick only Emplid with 5 alphanumeric and pass in .
  3. If in case excel cell is empty then it should go in else condition .

Please let me know if anyone know solution for this case.

image

@Krishnakumar_Vasudevan

Use read range for reading excel

Use for each row in datatable

Inside use if activity condition

System.text.regularexpression.regex.Ismatch(Currentrow(“EMPID”).Tostring,“[A-Z]{3}\d{2}|\d{2}[A-Z]{3}”)

1 Like

Getting error "78YYY does not belong to table datatable ", Please advice

@Krishnakumar_Vasudevan

can you share the error screenshot

Hi @Krishnakumar_Vasudevan

You can try this

I/P:

BlankProcess12.zip (59.7 KB)

Hope this helps!!

Can you please copy/paste IF condition which you have used in your code.

@Krishnakumar_Vasudevan

System.Text.RegularExpressions.Regex.IsMatch(CurrentRow("EMPID").ToString,"[A-Z0-9]{5}")

EmpID=System.Text.RegularExpressions.Regex.Match(CurrentRow("EMPID").ToString,"[A-Z0-9]{5}").Value

@Krishnakumar_Vasudevan

You can also use this
If the previous one doesnt work for you

System.text.regularexpression.regex.Ismatch(Currentrow(“EMPID”).Tostring,“[A-Z]+\d{2}|\d{2}[A-Z]+”)

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