Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

how to get all the items from array/Select instead of one item

(0) ShareShare
ReportReport
Posted on by

Hi All,

 

Select (action) has many items in the collection, when I am trying to get a list of items it returns only the first item.

[
 {
 "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups(id,displayName)",
 "value": [
 {
 "id": "99b3391d",
 "displayName": "GAAD"
 },
 {
 "id": "0a12462f",
 "displayName": "BAAD"
 }
 ]
 }
]

 

muralikrishna12_0-1668966196366.png

from the above screenshot, we can see it returned only one item from the collection.

 

Any help to get all the items instead of one row/item

here is the formula that is currently being used.

 

Item()['value']?[0]?['id']
Item()['value']?[0]?['displayName']

also tried like 
Item()['value']?[0]['id']
Item()['value']?[0]['displayName']

also tried like 
Item()['value']?[0]['id']
Item()['value']?[1]['displayName']

muralikrishna12_1-1668966654221.png

 

 

any assistance on how to get all the array items?

 

  • Community Power Platform Member Profile Picture
    on at
    Re: how to get all the items from array/Select instead of one item

    what if we have another array in the Json object ?

    here is the invoke an HTTP output

    {
     "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('cc0-975b-e658c2672639')/licenseDetails",
     "value": [
     {
     "id": "htXLQs5wFWA",
     "skuId": "cb42ce701560",
     "skuPartNumber": "POWER_BI_PRO",
     "servicePlans": [
     {
     "servicePlanId": "440-bddc-54d774bf0318",
     "servicePlanName": "EXCHANGE_S_FOUNDATION",
     "provisioningStatus": "Success",
     "appliesTo": "Company"
     },
     {
     "servicePlanId": "bfd3-562de28bd4ba",
     "servicePlanName": "BI_AZURE_P2",
     "provisioningStatus": "Success",
     "appliesTo": "User"
     }
     ]
     }

    we are trying to get the user license and sublicense as well.

    So i can able to get the first-level license details(id, skuid, skuPartNumber)

    but not from the "servicePlans" field values.

    muralikrishna12_0-1669203063075.png

     

    any assistance please add Serviceplan(Sub-License) array fields into the current license.

     

     

  • Expiscornovus Profile Picture
    31,641 Most Valuable Professional on at
    Re: how to get all the items from array/Select instead of one item

    Hi @Anonymous,

     

    You are using an index [0]. This means you are only retrieving the first item.

     

    I would use the value property in the From field of the Select action. This way you can use/map the properties of the value array in the Map field. 

     

    I assume currently you are using the body of the Invoke an HTTP request 2 action in the Set variable action?

     

    Use the below expression instead to retrieve the value property:

     

    body('Invoke_an_HTTP_request_2')['value']

     

     

    In the map field you could refer to the specific properties of that array by using the item()?['nameofpoperty'] format.

     

    id would be:

     

    item()?['id']

     

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,658 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow