Question

Can I strip characters from a string in formulas (business processes)

Is it possible with a formula to change the belgium BTW-nummer like BE0123.456.789 in 0123456789 (strip spaces, dots...) so we can search in our database to find the correct account? People have different ways to write their number. 

I can only find functions with dates and integers (like RoundUp(), Minimum(), Day(),...)

Is there something like regular expressions in PHP to replace "." by "" and "BE" by "" and " " by ""?

Like 0

Like

2 comments

Unfortunately, there is no opportunity to process string in the Formula business process element. However it's possible to implement using the Script task element. There is an example of C# code snipped below:

  var subjectString = "BE0123.456.789";

var resultString = System.Text.RegularExpressions.Regex.Replace(subjectString, "[^0-9]", "");

Thanks. I discovered today also that I can use C# functions in the formula of business processes. So this did the work for me: [#lees inschrijvingen.Eerste item van de resulterende collectie.BTW-nummer#].Replace(".","").Replace("x","").Replace(" ","").Replace("BE","")

Show all comments