• DOCUMENTATION
  • WORKATO BLOG
  • PRODUCT BLOG
  • Return to Workato
  • Log in
  • ☰
  • Solutions Articles
  • Forums/Discussions
  • Submitted Tickets
New Topic
Discussions Recipe Building Formula Mode Questions
S

Saul Macht

started a topic about 3 years ago
Answered

What formula can I use to check if a string is entirely digits?

As mentioned in the title, what formula can I use to check if a string is entirely digits?


Best Answer
C
CJ Wee said about 3 years ago

Hi Saul,


You can use the .match formula together with a regex (regular expression).


The formula .match checks if your data pill contains a certain pattern (which can be a regex, or a string). If there is a match, the formula will evaluate to true, if not, false.


The formula will look like this: <data pill>.match?(/^[0-9]+$/).


image


Using this formula, if your data pill only contains digits, it will evaluate to true, and if it contains characters other than digits, it will evalute to false.


Try it out and let us know if it works.


Thanks!



Answer

CJ Wee

said about 3 years ago

Hi Saul,


You can use the .match formula together with a regex (regular expression).


The formula .match checks if your data pill contains a certain pattern (which can be a regex, or a string). If there is a match, the formula will evaluate to true, if not, false.


The formula will look like this: <data pill>.match?(/^[0-9]+$/).


image


Using this formula, if your data pill only contains digits, it will evaluate to true, and if it contains characters other than digits, it will evalute to false.


Try it out and let us know if it works.


Thanks!



Login to post a comment

Still can't find your solution?

Send us a ticket, we will try our best to assist you with your problem

Documentation
Developer's Library
Tutorials
eBooks
Product Hour
Product Blog
Workato Blog
Product updates
Customer Stories
© Workato 2020   Privacy   Terms   +1 (844) 469-6752
  • Documentation
  • Workato Blog
  • Product Blog
  • Solutions
  • Forums
  • Tickets
  • Log in
  • Return to Workato