Alphanumeric Conditon

Hi,

I have an IF Condition (below) which checks if an Employee Code is in an excel sheet is numeric and if so it proceeds with running through a process. It is all working fine.
However I have now come across a situation where the employee code is Alphanumeric.

Would anyone be able to give me a steer on how I could modify the below to include Alphanumeric? E.g. If Employee Code is Numeric or AlphaNumeric

Current Condition:
IsNumeric(EmployeeCode)

Thanks

@TonyR1 - Click the on the + sign and choose condition builder…
and write your condition as below

image

1 Like

Apologies, I seem to have put this post in Studio X category instead of Studio.
I don’t believe the condition builder is available in Studio (if it is I can’t see it!).

Np…since you posted under Studiox i have provided that solution…

check this post…

1 Like

Hi!

You can use simply an Is Match Activity with simply “\d”

Every string that has at list 1 number in it will be a match

Is it possible to do it using an existing If Activity?
I would like to make as few changes as possible to existing automation.

@TonyR1 - Here you go…

Excellent Prashat, I get what you are saying now.
How do you apply it to a variable like I had previously?

e.g. IsNumeric(CurrentEmployeeCode)?

@TonyR1 - Here you go…

EmployeeCode.IsNumeric or (Regex.Matches(EmployeeCode,“[1]+$”).Count >= 1)


  1. a-zA-Z0-9 ↩︎

1 Like

@TonyR1 - Please mark my post as solution, if it solves your query.

I recommend follow code.

Regex.Matches(src,“[^\w]+”).Count = 0

this code ‘Regex.Matches(src,“[^\w]+”)’ mean that src string contains characters other than AlphaNumeric.

@prasath17 I will testing this later this afternoon and will update you.

Many thanks

Hi @prasath17 thank you that worked.

1 Like

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