Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Return value from multiple array entries

(0) ShareShare
ReportReport
Posted on by 85

Hi,

 

I have an array called "in_groups". The "in_group" array has a value called "group_label". I would like to create an expression that would return just the value of both group lables. Normally, this would be a for-each operation, but i would like to combine the results so that my output looks like this:

 

All users

Global Users 

 

{
"in_groups": [
{
"group_id": 2,
"group_label": "All users",
"_is_system": true
},
{
"group_id": 4,
"group_label": "Global Users",
"_is_system": false
}
]
}

  • JoeO Profile Picture
    85 on at
    Re: Return value from multiple array entries

    Reviewed this again real quick, i do understand the solution and its working well. Just wondering whether its possible to simplify, esle i'll stick with this.

     

    Thanks!!

  • JoeO Profile Picture
    85 on at
    Re: Return value from multiple array entries

    I actually tried the "Select" operation as a more simple approach, and it seems to work, but im trying to figure out (if possible) how to just retrieve the values w/o the rest. Currently im getting this (with the select operation):

    [
    "All users",
    "Global User"
    ]

     

    In_Group.png

     

  • JoeO Profile Picture
    85 on at
    Re: Return value from multiple array entries

    Hi Kris,

    Thanks so mcuh for the detailed response. Really appreciate your insight. I've tested it, and get the desired results in the second “Apply to each” step. The question is, i've been trying to understand what it is that you're doing, but im not fully understanding it. If you dont mind, can you give me a brief explanation on what we’re doing here, especially the initialize variable step and the 2 outputs?

     

  • v-xida-msft Profile Picture
    on at
    Re: Return value from multiple array entries

    Hi @JoeO,

     

    Could you please share a screenshot of your flow's configuration?

     

    I have made a test on my side and please take a try with the following workaround:

    • Add a proper trigger, here I use Flow Button trigger.
    • Add a Compose action, Inputs field set to following json data that you provided:
    {
    "in_groups": [
    {
    "group_id": 2,
    "group_label": "All users",
    "_is_system": true
    },
    {
    "group_id": 4,
    "group_label": "Global Users",
    "_is_system": false
    }
    ]
    }
    • Add a Variables-> "Initialize variable" action, Name set to FinalValue, Type set to String and Value set to empty.
    • Add a "Apply to each" action, input parameter set to following formula:
    outputs('Compose')?['in_groups']
    • Within "Apply to each" action, add a "Compose 2" action, Inputs set to FinalValue variable. Add a "Compose 3" action, Inputs set to following formula:
    item()?['group_label']

    Add a "Set variable" action, Name set to FinalValue variable, Value set to following formula:1.JPG

    In first line, type the output of the "Compose 3" action. In second line, type the output of the "Compose 2" action.

     

    • Under "Apply to each" action, add a "Compose 4" action, Inputs field set to FinalValue variable.

    Image reference:2.JPG

     

    3.JPG

     

     

    The flow works successfully as below:4.JPG

     

    More details about using expression in flow actions, please check the following article:

    Use expression in flow actions 

     

    Best regards,

    Kris

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1