I have this condition here, it extracts that ‘CPP’ value from an excel file and if it finds that it needs to replace it with a value on the assign activity. What it does it is, it identifies that CPP value but it still goes to the ‘else’ side and sends an email that is on the else.
That’s odd. Try printing the product name once. Also debug it thoroughly.
If you are extracting product name from some website or email, there is high chances of special invisible characters attached to the string. Try logging the length of the product name variable to check any invisible characters present.
If possible try sharing a sample workflow to reproduce the issue.
is the name “CPP” or in another case (lower or sentence case)? accordingly modify your condition.
Put a breakpoint on If statement then debug the code, watch from locals panel, what is the value coming in productName variable? Does it contain any spaces? or is it in any other case? Does it contain any extra characters?
This will help you pinpoint the problem.
if productname only contains CPP then better to use Equals function rather than Contains. When you hit breakpoint on if, go to immediate panel and test the result of below expressions..
ProductName.ToString.Trim.Equals(“CPP”)
ProductName.ToString.Contains(“CPP”)
ProductName.ToString.Length
ProductName.ToString.ToLower.Contains(“cpp”)
ProductName.ToString.ToUpper.Contains(“CPP”)
try different combinations, will help you identify the problem.