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"
}
]
}
]
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']
any assistance on how to get all the array items?
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.
any assistance please add Serviceplan(Sub-License) array fields into the current license.
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']
WarrenBelz
146,658
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional