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 / how to get all the ite...
Power Automate
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?

 

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    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']

     

     

  • Community Power Platform Member Profile Picture
    on at

    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.

     

     

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard