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

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Email Not Recognizing Output

(0) ShareShare
ReportReport
Posted on by 12

I am trying to send an email but the email is not recognizing the output when stored in a string variable. 

 

The result from sending email:

pic1.png

 

Code that is stored in string variable:

<p><a href="@{outputs('Compose_Link')[0]}">@{split(outputs('Compose_Articles')[0], outputs('Compose_Newline'))[2]}</a><br /><em>@{trim(split(outputs('Compose_Articles')[0], outputs('Compose_Newline'))[0])}, @{split(outputs('Compose_Articles')[0], outputs('Compose_Newline'))[1]}<br /></em>@{split(outputs('Compose_Articles')[0], outputs('Compose_Newline'))[3]}</p>

 

Code if manually typed in email body (result I want to get):

pic2.png

 

How can I go about having the email to recognize my outputs without manually copy-pasting in email?

I have the same question (0)
  • Expiscornovus Profile Picture
    32,910 Most Valuable Professional on at
    Re: Email Not Recognizing Output

    Hi @purpur,

     

    Can you share a screenshot of your variable action. Just want to make sure that the expressions are actually recognized as expression and not just as plain text.

     

     

    If all goes well the expression should be shown with the fx icon in your initialize variable action. See an example of that below:

     

    emailbody_stringvariable.png

     

     

  • purpur Profile Picture
    12 on at
    Re: Email Not Recognizing Output

    Hi @Expiscornovus,

     

     

    This is the variable initialized at the start of flow:

    pic2.png

     

     

    This append to string variable inside an Apply to each:

    pic1.png

     

     

    You might be right as it is being recognized as plain text when I use the dynamic content, Email Body, in Send an email. Any way to solve this?

  • Expiscornovus Profile Picture
    32,910 Most Valuable Professional on at
    Re: Email Not Recognizing Output

    Hi @purpur,

     

    Can you check the Append to string variable action in edit mode instead of the flow history. Do you see that the functions like split, trim are shown as expressions or just as regular text?

     

    appendtostringvariable.png

  • purpur Profile Picture
    12 on at
    Re: Email Not Recognizing Output

    Hi @Expiscornovus,

     

     

    Yes, they are showing as expressions

    pic1.png

  • Expiscornovus Profile Picture
    32,910 Most Valuable Professional on at
    Re: Email Not Recognizing Output

    Hi @purpur,

     

    Ok, that looks good. Can we troubleshoot the expressions itself.

     

    So, for instance the expression for the label of the hyperlink. What is the value you are inputting and what value are you expecting to get out of it?

    split(outputs('Compose_Articles')[0], outputs('Compose_Newline'))[2]

     

     

  • purpur Profile Picture
    12 on at
    Re: Email Not Recognizing Output

    Hi @Expiscornovus,

     

     

    This is the expected email to receive:

    pic1.gif

     

     

    This is to get from first word doc (array index 0) and split this doc line by line (Compose_Newline) and array index [2] in this case to determine which line of text to input.

    split(outputs('Compose_Articles')[0], outputs('Compose_Newline'))[2]

     

  • Expiscornovus Profile Picture
    32,910 Most Valuable Professional on at
    Re: Email Not Recognizing Output

    Hi @purpur,

     

    Thanks for clarifying what you want to achieve.

     

    Can you share the values (or screenshots) of the compose articles and compose new line actions of the flow history run which didn't work as expected?

     

    Just want to double check if I can retrieve that hyperlink label field value with the same split expression.

  • purpur Profile Picture
    12 on at
    Re: Email Not Recognizing Output

    Word docx is converted to txt file using Encodian's Convert Word

    pic1.gif

    base64ToString(outputs('Convert_Word')?['body/FileContent'])

     

    Compose Newline, to use to split whenever there is a newline

    decodeUriComponent('%0A')

     

  • Expiscornovus Profile Picture
    32,910 Most Valuable Professional on at
    Re: Email Not Recognizing Output

    Hi @purpur,

     

    Within that Compose Articles action you are converting the file content into a string. However, in your append to string variable action you are referring to the first item of an array.

     

    That setup errors in my test because it is a string and not an array.

    getitemfromcollection.png

     

    Can you try and use the compose articles with the [0] index reference?

    split(outputs('Compose_Articles'), outputs('Compose_Newline'))[2]

     

  • purpur Profile Picture
    12 on at
    Re: Email Not Recognizing Output

    This is the code in Append to string variable (Email Body) in an Apply to each. 

    I choose to use variables('Count') so it can be dynamic.

    concat('<p><a href="@{outputs(''Compose_Link'')[', variables('Count'), ']}">', '@{split(outputs(''Compose_Articles'')[', variables('Count'), ']', ', outputs(''Compose_Newline''))[2]}</a><br /><em>@{trim(split(outputs(''Compose_Articles'')[',variables('Count'), ']',', outputs(''Compose_Newline''))[0])}, @{split(outputs(''Compose_Articles'')[',variables('Count'), ']',', outputs(''Compose_Newline''))[1]}<br /></em>@{split(outputs(''Compose_Articles'')[',variables('Count'), ']',', outputs(''Compose_Newline''))[3]}</p>')

    But when I use Email Body variable, it does not recognize the variable and instead sends as a plain text.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 614 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 401 Moderator

#3
chiaraalina Profile Picture

chiaraalina 282

Last 30 days Overall leaderboard