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
@TonyR1 - Click the on the + sign and choose condition builder…
and write your condition as below
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…
I can check if a string contains an integer but unable to do for a alphabet?
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.
Excellent Prashat, I get what you are saying now.
How do you apply it to a variable like I had previously?
@TonyR1 - Here you go…
EmployeeCode.IsNumeric or (Regex.Matches(EmployeeCode,“+$”).Count >= 1)
@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.
@prasath17 thank you that worked.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.