BpmFunc.Replace not giving expected result

I am attempting to create a BPM that uses the BpmFunc.Replace function to remove the two dashes of the {ttCustomer.PhoneNum}. If I simply have the expression (see screenshot) to force the PhoneNum to equal the string “TEST”, it works just fine. The PhoneNumber changes to the string “TEST” upon hitting save. If I change the expression to use the .Replace function it removes the phone number in its entirety and leaves the field blank.

Am I missing something in the expression?

Have you tried using the standard String.Replace() method? I’ve never used the BpmFunc.Replace.

ttCustomerRow.PhoneNum.Replace("-", " ") should work in an expression.

No, I have not tried that. I will give that a shot and update this thread on the outcome. Thanks for your suggestion.

1 Like

What happens if you do string.Format(“TEST {0}”, ttCustomerRow.PhoneNum.ToString()); just curious how that carries through before moving forward. The fix might be as simple as adding ToString to get it from object to string type. Or just swapping to good old string replace.

The BpmFunc.Replace removed “-” and replaced " " on my end. Could the ttCustomerRow.PhoneNum be an empty string?

No, ttCustomerRow.PhoneNum is definitely not blank. I did alter the expression to use ttCustomerRow.PhoneNum.Replace("-", " ") as you suggested and that worked like a charm. So really not sure why BpmFunc.Replace isn’t working.