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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Store variable name in...
Power Automate
Unanswered

Store variable name in excel file and send email by template

(0) ShareShare
ReportReport
Posted on by 6

Dear Supporter,

I have a scenario which I need to send email based on master table. 

Master table: 

Email Template CodeInvoice NumberInvoice DateClient IDAmountAttach file 
001ABC11206-Jun-2023AA123$10NO
002ABC11306-Jun-2023BB789$20YES

 

According to Email Template Code, I need to lookup To, Cc, Subject and email content from other table.
Email Template table:

Email Template CodeToCcSubjectContent
001abc@outlook.com;efg@outlook.comqwe@outlook.comAAA company Invoice Number: {var:  Invoice Number from master table}

Dear all,

 

Please see the data as below:
{var: Invoice Number}
{var: Invoice Date}

002hijk@outlook.com;opq@outlook.connm@outlook.comBBB company Client ID: {var:  Client ID from master table}

Dear all,

 

Please find attached file for the client:

Client ID: {var: Client ID}
Amount: {var: Amount}

 

 

 

At the beginning, I think Power Automate flow can be stored variable name in excel file as img 1, but the result fail to show as img 2. Is there anyone has idea to achieve my scenario by Power Automate Flow? Appreciated for any response.

 

img 1

henryyy_1-1686034379071.png

 

img 2

 

henryyy_2-1686034583589.png

 

expected result:

 

email subject: AAA company Invoice Number: ABC112

Categories:
I have the same question (0)
  • v-wenjuan-msft Profile Picture
    Microsoft Employee on at

    Hi @henryyy ,

     

    Could you share screenshot of your flow to see how do you set your action?

     

    The issue seems to be caused by you typing in the function in Subject field directly rather than expression bar.

     

    Community Support Team _ Wenjuan Zou

    If this post helps, then please consider Accept it as the solution to help the other members find it.

     

  • henryyy Profile Picture
    6 on at

    @v-wenjuan-msft 

    the code view as below:

    "emailMessage/Subject": "@body('Filter_array_2')[0]['Subject']"

    henryyy_1-1686036257450.png

     

     

     

  • VictorIvanidze Profile Picture
    13,079 on at

    It will not work - you cannot evaluate variables in the flow.

     

  • v-wenjuan-msft Profile Picture
    Microsoft Employee on at

    Hi @henryyy ,

     

    The code you shared should be right to work.

    How about to check the first object from "Filter array 2"?

    Meanwhile, seems your filter array 2 is not complete. No parameter on right side will lead to an empty array.

    vwenjuanmsft_0-1686537072860.png

     

    Community Support Team _ Wenjuan Zou

    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • henryyy Profile Picture
    6 on at

    hi @v-wenjuan-msft ,
    Thanks for studying my case. For "Filter array 2" object, it refers to email template table.

    Then, I use Email Template Code from Master table to lookup value at email template table. As the output of "Filter array 2" is unique value, that's why use body('Filter_array_2')[0]['Subject'] to get the variable name saved in  email template table.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 176 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 96 Super User 2026 Season 1

Last 30 days Overall leaderboard