• Documentation
  • Workato Blog
  • Product Blog
  • Return to Workato
  • Login
  • Automation Institute
  • Documentation
  • Community Forums
New Topic
Discussions Recipe Building Formula Mode Questions
S

Saul Macht

started a topic almost 6 years ago
Answered

Formula to get acronym of a phrase

Hi, I was trying to create a formula to get an acronym. I have one that works but it is manual and not elegant. I'm wondering if anyone has a better formula to offer.


Mine:


[Phrase].split.first[0]+[Phrase].split.first(2).last[0]+[Phrase].split.first(3).last[0]+[Phrase].split.first(4).last[0]).slice(0..[Phrase].split.length-1)


Limitation: This works only for up to 4 words in the phrase.


Best Answer
P
Patricia Guevarra said almost 6 years ago

Hi Saul!


You can try using this formula: 

image


Here is how this formula works:

The scan formula looks through your string and returns a list of results that matches the pattern you put in between the forward slashes. You can learn more here: https://support.workato.com/solution/articles/1000244152-formula-mode-how-to-use-the-scan-function-

The pattern placed between the forward slashes are interpreted in this manner:

\b refers to word boundaries -- a space in this case

\w refers to alphanumeric characters that come after non-alphanumeric characters


The join formula puts lists or arrays together, joined by the character specified between the quotes. You can use other characters aside from the period. 


I hope this helps!

Answer

Patricia Guevarra

said almost 6 years ago

Hi Saul!


You can try using this formula: 

image


Here is how this formula works:

The scan formula looks through your string and returns a list of results that matches the pattern you put in between the forward slashes. You can learn more here: https://support.workato.com/solution/articles/1000244152-formula-mode-how-to-use-the-scan-function-

The pattern placed between the forward slashes are interpreted in this manner:

\b refers to word boundaries -- a space in this case

\w refers to alphanumeric characters that come after non-alphanumeric characters


The join formula puts lists or arrays together, joined by the character specified between the quotes. You can use other characters aside from the period. 


I hope this helps!

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 2022   Privacy   Terms   +1 (844) 469-6752
  • Documentation
  • Workato Blog
  • Product Blog
  • Solutions
  • Forums
  • Tickets
  • Log in
  • Return to Workato
Topic views count