cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
frankc9
Advocate I
Advocate I

Turn Variable Into an Email Address

Hello,

 

How would I go about taking a variable and turning it into an email address?

 

For example, I have a flow that retrieves a users first and last name that is stored into a variable and I need to send that user an email.

 

FirstNameLastInitial@domain.com

John Contoso > JohnC@domain.com

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Mark-Shenouda
Microsoft
Microsoft

@frankc9 
Hope you are well, 
I believe you can achieve this by using multiple actions, 

  1. Use SplitText action to split the first and last name by Spaces
    Mark-Shenouda_0-1618743036047.png
  2. you will now have a list of text, that contains 2 items , now you can use the Get Sub text action to get the first character of the Last name as below 

    Mark-Shenouda_1-1618743131079.png

  3. Finally you can concatenate them in a variable and do the desired operation 

Hope this helps 
Best Regards

 

View solution in original post

5 REPLIES 5
Paulie78
Super User
Super User

Try this expression:

concat
(
split(variables('Name'), ' ')[0],
substring(split(variables('Name'), ' ')[1], 0,1),
'@domain.com'
)

 Screenshot:

2021-04-15_16-38-42.png

Thank you for the quick reply!

 

I am sorry, I should have added if it would be possible to do this in Automate Desktop? Currently, I have an unattended desktop flow triggered by the cloud connection.

Paulie78
Super User
Super User

I have no doubt it is possible. But I have hardly use Power Automate Desktop, so I cannot tell you how to do it. It's something I hope to spend more time on very soon.

Mark-Shenouda
Microsoft
Microsoft

@frankc9 
Hope you are well, 
I believe you can achieve this by using multiple actions, 

  1. Use SplitText action to split the first and last name by Spaces
    Mark-Shenouda_0-1618743036047.png
  2. you will now have a list of text, that contains 2 items , now you can use the Get Sub text action to get the first character of the Last name as below 

    Mark-Shenouda_1-1618743131079.png

  3. Finally you can concatenate them in a variable and do the desired operation 

Hope this helps 
Best Regards

 

@Mark-Shenouda 

 

Hope you are doing well yourself!  This was exactly what I was looking for and I was able to piece it all together.  At one point I was in the right spot, but couldn't figure out how to pull the first and last name from the split text.  

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,964)