web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Using Variable string ...
Power Automate
Answered

Using Variable string as Outlook recipient

(0) ShareShare
ReportReport
Posted on by 19

Hi All, 

 

I have been struggling to get this working and I am not sure if its possible. 

 

I am trying to compose an email address from a full name. To test I am using my own name instead of a dynamic expression. For this example, I am using 'Andrew Tyrrell' but this name will change once it's live. 

 

Then using 'First' & 'Last' to separate the name and create an email address as an output. 

 

First(Split('Andrew Tyrell', ' '))last(Split('Andrew Tyrell', ' '))

 

Output: Andrew 

 

last(Split('Andrew Tyrell', ' '))

Output: Tyrrell 

 

Compose both these outputs to form an email address: 

 

@{outputs('Compose')}.@{outputs('Compose_2')}@***************.org

Output: Andrew.Tyrrell@*****************.org

 

 

I then want to store this email address in a variable to then use later on as a recipient for outlook 

 

flow email.PNG 

 

Doing it this way spits out the following error:

 

"InvalidTemplate. Unable to process template language expressions in action 'Send_an_email' inputs at line '1' and column '2503': 'The template language expression 'json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$connections']['shared_office365']['connectionId']' cannot be evaluated because property 'shared_office365' doesn't exist, available properties are ''. Please see https://aka.ms/logicexpressions for usage details.'."

 

The variable doesn't match the input format of outlook. But I don't know why, I have tried storing the variable in various ways, but I can't get it working. 

 

Any help would be appreciated, there is most likely a much simpler way of doing this. 

 

Thanks in advance! 

 

Categories:
  • Verified answer
    v-bacao-msft Profile Picture
    Microsoft Employee on at

    Hi @Tyrrell94,

     

    You could first output the value of the variable, and if it is an invalid email address format, it will report an error.

    I did a test on my side. The way to stitch emails may be different from yours. You could use them for reference:

    Compose-Email: 

    concat(outputs('First_Name'),'.',outputs('Last_Name'),'@test.com')

    2.PNG

    In addition, if the email address of your variable output is valid, then you could consider exporting the Flow and re-importing it as a new Flow. This way Flow will work.

    Please take a try and let me know if issue still exists.

     

    Best Regards,

    Barry

     

  • Tyrrell94 Profile Picture
    19 on at

    Hi @v-bacao-msft

     

    Sorry for the late response. I did try this before the new year but I couldn't get it working. 

     

    Hope you had a nice Christmas and New year! 

     

    I took a break and came back to it in the new year and I have managed to get it working using the method you have shown. 

     

    Appreciate the help! 

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 355

#2
11manish Profile Picture

11manish 336 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard