When using functions that take regex inputs, Workato will only allow "literal" regex inputs to be used in those functions.
Example:
"My Workato subscription costs 123.45 dollars".scan(/[0-9]{1,6}[.][0-9]{2}/)
will yield an array of ["123.45"]
However, I want the regex value of [0-9]{1,6}[.][0-9]{2} to come from a previous Data Pill. In normal Ruby, I would do the following:
r = "[0-9]{1,6}[.][0-9]{2}"
"My workato subscription costs 123.45 dollars".scan(/#{r}/)
This would yield ["123.45"].
However, the ruby formula processor in Workato does not support #{} notation.
Could Workato implement it?
Amanda Wong
said
about 6 years ago
Hi Rachel,
The formula mode does not currently support regex inputs from data pills. However, this is possible using the Ruby connector. I have created a recipe for your reference. Let us know if this works for you.
Rachel Beck
implement #{} notation in formula processor
When using functions that take regex inputs, Workato will only allow "literal" regex inputs to be used in those functions.
Example:
"My Workato subscription costs 123.45 dollars".scan(/[0-9]{1,6}[.][0-9]{2}/)
will yield an array of ["123.45"]
However, I want the regex value of [0-9]{1,6}[.][0-9]{2} to come from a previous Data Pill. In normal Ruby, I would do the following:
r = "[0-9]{1,6}[.][0-9]{2}"
"My workato subscription costs 123.45 dollars".scan(/#{r}/)
This would yield ["123.45"].
However, the ruby formula processor in Workato does not support #{} notation.
Could Workato implement it?