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 / Unable to create and s...
Power Automate
Answered

Unable to create and set a variable to hold array element

(0) ShareShare
ReportReport
Posted on by

Apologies if this seems trivial but I've had no luck in getting something to work. I have the following Select in my flow

JWessel_0-1705175346406.png

What I want to do is to take that output value, put it into a variable so that I can use the  email address in a send email operation at the end of the flow.  Any help is appreciated.  

Categories:
I have the same question (0)
  • Verified answer
    Ellis Karim Profile Picture
    11,931 Super User 2026 Season 1 on at

    Hi @JWessel ,

     

    In the Select action, switch to text-mode then enter your expression for the email into the Map. Example:

    Snag_ae2444d.png

    The output will be an array. If the result will only ever have one email address in the output you can use the First function and then reference the email property. Please provide more info.


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as ☑️ Solved.
    If you like my response, please give it a Thumbs Up.
    My Blog Site

  • Pstork1 Profile Picture
    69,018 Most Valuable Professional on at

    use the first() function to get the record out of the data select array and manually reference the email key.

    first(outputs('Select'))?['email']
  • JWessel Profile Picture
    on at

    @ekarim2020, what is the full json expression?  Apologies, I am not familiar with that function

  • JWessel Profile Picture
    on at

    @Pstork1 I tried the first function and it failed because result of Select is an object and not an array. I'm going to try the json function mentioned above and then try using the first function.

  • Verified answer
    Ellis Karim Profile Picture
    11,931 Super User 2026 Season 1 on at

    Hi @JWessel ,


    The expression in the previous screenshot was just an example.  For your data it will be:

    item()?['SendTo']

     

    Snag_af70a3b.png

     


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as ☑️ Solved.
    If you like my response, please give it a Thumbs Up.
    My Blog Site

  • Verified answer
    Pstork1 Profile Picture
    69,018 Most Valuable Professional on at

    You could use just the first function in an object variable or a compose.  If you want it in a string variable then you have to manually add the field name as I did in the code above.  That's what the ?['email'] is for after the first function.

  • JWessel Profile Picture
    on at

    @ekarim2020 , @Pstork1  both of you have been extremely helpful in a solution.  I will try to mark both of the inputs from you as solutions.

  • JWessel Profile Picture
    on at

    I did realize that I already had an array earlier in the flow so did not have to use any conversion from object to an array.  I've been virtually banging my head against the wall on this full flow out of Power BI report for a couple days now and you and Ellis have been the pain relievers and repaired the drywall at the same time.  Many Thanks !!

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
David_MA Profile Picture

David_MA 77 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 68

#3
Expiscornovus Profile Picture

Expiscornovus 56 Most Valuable Professional

Last 30 days Overall leaderboard