I'm having a discrepancy using the "Get HTTP Request" (Preview). I'm pretty sure it is how I'm parsing the JSON and could use some assistance.
Test #1 (Works) - Get owners from a static group where I know what the <id> is, and add them as owners to a newly created group:
https://graph.microsoft.com/v1.0/groups/<groupid>/owners
{
"type": "object",
"properties": {
"@@odata.context": {
"type": "string"
},
"value": {
"type": "array",
"items": {
"type": "object",
"properties": {
"@@odata.type": {
"type": "string"
},
"id": {
"type": "string"
},
"businessPhones": {
"type": "array",
"items": {
"type": "string"
}
},
"displayName": {
"type": "string"
},
"givenName": {
"type": "string"
},
"jobTitle": {},
"mail": {
"type": "string"
},
"mobilePhone": {},
"officeLocation": {},
"preferredLanguage": {
"type": "string"
},
"surname": {
"type": "string"
},
"userPrincipalName": {
"type": "string"
}
},
"required": [
"@@odata.type",
"id",
"businessPhones",
"displayName",
"givenName",
"jobTitle",
"mail",
"mobilePhone",
"officeLocation",
"preferredLanguage",
"surname",
"userPrincipalName"
]
}
}
}
}
This works because, after parsing the JSON, the <id> (GUI) for each Owner is being parsed from the JSON and listed in the dynamic content box:
Test #2 - Now, I need to get the Group ID for the Team I just created.
{
"type": "object",
"properties": {
"@@odata.context": {
"type": [
"string",
"null"
]
},
"value": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": [
"string",
"null"
]
},
"description": {
"type": [
"string",
"null"
]
},
"displayName": {
"type": [
"string",
"null"
]
},
"mail": {
"type": [
"string",
"null"
]
},
"deletedDateTime": {},
"classification": {},
"createdDateTime": {
"type": [
"string",
"null"
]
},
"creationOptions": {
"type": "array",
"items": {
"type": [
"string",
"null"
]
}
},
"expirationDateTime": {},
"groupTypes": {
"type": "array",
"items": {
"type": [
"string",
"null"
]
}
},
"isAssignableToRole": {},
"mailEnabled": {
"type": "boolean"
},
"mailNickname": {
"type": [
"string",
"null"
]
},
"membershipRule": {},
"membershipRuleProcessingState": {},
"onPremisesDomainName": {},
"onPremisesLastSyncDateTime": {},
"onPremisesNetBiosName": {},
"onPremisesSamAccountName": {},
"onPremisesSecurityIdentifier": {},
"onPremisesSyncEnabled": {},
"preferredDataLocation": {},
"preferredLanguage": {},
"proxyAddresses": {
"type": "array",
"items": {
"type": [
"string",
"null"
]
}
},
"renewedDateTime": {
"type": [
"string",
"null"
]
},
"resourceBehaviorOptions": {
"type": "array",
"items": {
"type": [
"string",
"null"
]
}
},
"resourceProvisioningOptions": {
"type": "array",
"items": {
"type": [
"string",
"null"
]
}
},
"securityEnabled": {
"type": "boolean"
},
"securityIdentifier": {
"type": [
"string",
"null"
]
},
"theme": {},
"visibility": {
"type": [
"string",
"null"
]
},
"onPremisesProvisioningErrors": {
"type": "array"
}
},
"required": [
"id",
"deletedDateTime",
"classification",
"createdDateTime",
"creationOptions",
"description",
"displayName",
"expirationDateTime",
"groupTypes",
"isAssignableToRole",
"mail",
"mailEnabled",
"mailNickname",
"membershipRule",
"membershipRuleProcessingState",
"onPremisesDomainName",
"onPremisesLastSyncDateTime",
"onPremisesNetBiosName",
"onPremisesSamAccountName",
"onPremisesSecurityIdentifier",
"onPremisesSyncEnabled",
"preferredDataLocation",
"preferredLanguage",
"proxyAddresses",
"renewedDateTime",
"resourceBehaviorOptions",
"resourceProvisioningOptions",
"securityEnabled",
"securityIdentifier",
"theme",
"visibility",
"onPremisesProvisioningErrors"
]
}
}
}
}
The flow runs properly and I get the exact output I expect. The HTTP Request is filtered and only returns the output for the new group name. However, the <id> field for just /groups/ is not available as dynamic content. :
I know it is there. I see it in my Output. I just can't pull it out. I need the ID as dynamic content, or at the very least, as a string variable, so I can use it in other parts of the flow.
Thanks in advance.
Hello @stayinginsync ,
you could try to extract the value from the JSON directly using an expression. I prefer that solution as it gives you more control over what you're extracting and it doesn't create such a terrible mess among the dynamic contents.
Thanks for the response.
That was what i wanted to do, and the first thing I tried (in fact I found that exact blog post in my research), but I couldn't figure out the right expression. Whenever I tried any combination of either body() or triggerOutput(), with the following, I kept getting invalid expression. I've lost track of how many different combinations I tried.
['value']?['id']
Thanks in advance.
Try this:
body('Send_an_HTTP_request')?['value'][0]?['id']
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
30 | |
27 | |
27 | |
21 | |
10 |