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

Joseph Chan

started a topic over 2 years ago
Answered

How to convert an email address into a username?

If I have an email address of first.last@company.com and my username format is first initial + last name, would this work in a formula?


email.scan(/\w+\)[0].slice(0)+email.scan(\w+\)[1]


Best Answer
Y
Yean Shan Chain said over 2 years ago

Hey Joseph, doing it in 1 formula will slightly complicated. You can simplify this by putting them into 2 steps. 


1. To get first name and last name from email - Here is the formula you can refer to 

MessageStep 2.split("@")[0]).split(".")[1]

2. To formulate the username, you can have a variable action and within the variable action, make use of formula to extract the first initial from the email data pill and concatenate with the output in the above step.

image




Answer
Y

Yean Shan Chain

said over 2 years ago

Hey Joseph, doing it in 1 formula will slightly complicated. You can simplify this by putting them into 2 steps. 


1. To get first name and last name from email - Here is the formula you can refer to 

MessageStep 2.split("@")[0]).split(".")[1]

2. To formulate the username, you can have a variable action and within the variable action, make use of formula to extract the first initial from the email data pill and concatenate with the output in the above step.

image




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