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 / How to access the valu...
Power Automate
Answered

How to access the value of an array

(1) ShareShare
ReportReport
Posted on by 21

Hi, is there a way to get the value of these using expression like @{first(body('Get_all_referrals')?['value'])?['id']}? I just want to get the values without using "Apply to each" action to loop inside the array of an array.

 

Capture.PNG

Categories:
I have the same question (0)
  • MattWeston365 Profile Picture
    1,701 on at

    You can use either the "first" expression, or what I prefer to do is identify the exact array index. E.g. if I wanted just the first item then I could do something like this:

     

    items()?['items'][0]?['team'][0]?['properties'][0]?['email']

  • linojr_asmolo Profile Picture
    21 on at

    Thanks for your reply. How can i achieve it with this. Thanks in advance.
    Capture.PNG

  • Verified answer
    MattWeston365 Profile Picture
    1,701 on at

    It should be something like this:

     

    body('Get_all_referrals')?['value'][0]?['customerProfile']['team'][0]?['email']

  • linojr_asmolo Profile Picture
    21 on at

    Thanks. I haven't tested the expression due access limitation for now, hopefully later given permission but i managed to do the expression using the format you've given.

     

    Is that format can be also used in in this flow? They have the same JSON schema.

    Capture.PNG

     

    I got this error:


    Capture1.PNG

     

    InvalidTemplate. Unable to process template language expressions in action 'Set_variable_2' inputs at line '1' and column '2090': 'The template language expression 'body('Parse_JSON')?['value'][0]?['customerProfile']['team'][0]?['email']' cannot be evaluated because property 'value' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.

  • linojr_asmolo Profile Picture
    21 on at

    Thanks. This one works. So, as long as the ['team'] in body('Get_all_referrals')?['value'][0]?['customerProfile']['team'][0]?['email'] is not empty. 

  • MattWeston365 Profile Picture
    1,701 on at

    Hi @linojr_asmolo you could build a number of checks in before hand to make sure that the values are there.

     

    E.g. you could use an expression: length(body('Get_all_referrals')?['value'][0]?['customerProfile']['team']) to see if it's greater than 0 (a team is present).

  • linojr_asmolo Profile Picture
    21 on at

    @MattWeston365 , Yupz, i've used that in the flow to check whether it's empty. Thanks, with the syntax you've shared, that gives me an understanding of how to access array. And I was able to modify the query expression in different ways. Thanks, this is really a big help.

  • linojr_asmolo Profile Picture
    21 on at

    Hi @MattWeston365 , how do i append an object to an array of type variable?

    This is the schema of my variable Owner:

     

    Capture.PNG

     

    This my Append Action:

    Capture.PNG

     

    But this gives me an error.
    Do you know something about it?

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 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard