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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Return value from mult...
Power Automate
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
}
]
}

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

    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

  • JO-30091535-0 Profile Picture
    85 on at

    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?

     

  • JO-30091535-0 Profile Picture
    85 on at

    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

     

  • JO-30091535-0 Profile Picture
    85 on at

    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!!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard