cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ThomasDK
Resolver II
Resolver II

"Headers" in response is missing

I have parsed the response from my "Create Team" action and cannot find out how to reveal the headsers I see in the raw output from the request:

ThomasDK_0-1642415658087.png

 

When I parse the response I only see "Body":

ThomasDK_1-1642415711062.png

 

I have tried to modify the default response, but no matter what I put here it does not generate an output with "Headers".

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Syndicate_Admin
Administrator
Administrator

The response headers are there, you just need to access them from the actions() method instead of the body() method. It will be something like this:

 

@{actions('Create_a_Microsoft_Team')['outputs']['headers']}

 

 

View solution in original post

@Syndicate_Admin 

Never mind. I had to go deeper into the rabbit hole, when I use the @actions function. This works:

actions('Get_Tabs_on_Channel')['outputs']['body']['value']

View solution in original post

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

The response headers are there, you just need to access them from the actions() method instead of the body() method. It will be something like this:

 

@{actions('Create_a_Microsoft_Team')['outputs']['headers']}

 

 

ThomasDK
Resolver II
Resolver II

Hi @Syndicate_Admin 

Thank you very much. I'm now able to access all values in the 'output' (

actions('Get_Tabs_on_Channel')['outputs'])
I'm new at this and no programmer 😉

 

One question you might be able to help me with. I'm trying to fetch 'id' in for each Tab the array of Tabs.

I get this error:

The execution of template action 'Apply_to_each_-_Delete_Wiki_tabs' failed: the result of the evaluation of 'foreach' expression '@body('Parse_JSON_-_Get_Tabs_on_Channel')?['body']?['body']?['value']' is of type 'Null'. The result must be a valid array.

 

The Output of the parsed 'Compose' is:

 

 

{
    "body": {
        "statusCode": 200,
        "headers": {
            "Transfer-Encoding": "chunked",
            "Vary": "Accept-Encoding",
            "Strict-Transport-Security": "max-age=31536000",
            "request-id": "4ae8634a-3acc-4d6c-a9c7-fa17c4e258b6",
            "client-request-id": "4ae8634a-3acc-4d6c-a9c7-fa17c4e258b6",
            "x-ms-ags-diagnostic": "{\"ServerInfo\":{\"DataCenter\":\"France Central\",\"Slice\":\"E\",\"Ring\":\"5\",\"ScaleUnit\":\"002\",\"RoleInstance\":\"PA3PEPF000001E2\"}}",
            "OData-Version": "4.0",
            "x-ms-apihub-cached-response": "false",
            "x-ms-apihub-obo": "false",
            "Date": "Thu, 20 Jan 2022 09:13:52 GMT",
            "Content-Type": "application/json; odata.metadata=minimal; odata.streaming=true; IEEE754Compatible=false; charset=utf-8",
            "Content-Length": "749"
        },
        "body": {
            "@odata.context": "https://graph.microsoft.com/beta/$metadata#teams('40bc1f5f-8376-4782-a32c-0843b37f3279')/channels('19%3AXthk8e-EuekugvJ781VxbY3DlgRruQT3rNnPOm7eENA1%40thread.tacv2')/tabs",
            "@odata.count": 1,
            "value": [
                {
                    "id": "8d198cc8-25cf-4481-8233-e3a4a7630e6a",
                    "displayName": "Wiki",
                    "teamsAppId": null,
                    "sortOrderIndex": "10000",
                    "messageId": null,
                    "webUrl": "https://teams.microsoft.com/l/channel/19%3aXthk8e-EuekugvJ781VxbY3DlgRruQT3rNnPOm7eENA1%40thread.tacv2/tab%3a%3a8d198cc8-25cf-4481-8233-e3a4a7630e6a?label=Wiki&groupId=40bc1f5f-8376-4782-a32c-0843b37f3279&tenantId=c06324e4-39db-442d-8b8a-965d1a19d46d",
                    "configuration": {
                        "entityId": null,
                        "contentUrl": null,
                        "removeUrl": null,
                        "websiteUrl": null,
                        "wikiTabId": 1,
                        "wikiDefaultTab": true,
                        "hasContent": false
                    }
                }
            ]
        }
    }
}

 

 

 

So, I don't know why my 'Value' here is not the right array?

ThomasDK_0-1642670685824.png

 

Best Regards,

Thomas

@Syndicate_Admin 

Never mind. I had to go deeper into the rabbit hole, when I use the @actions function. This works:

actions('Get_Tabs_on_Channel')['outputs']['body']['value']
Syndicate_Admin
Administrator
Administrator

Glad to hear it helped!

 

Please mark the answer so others will see this post as resolved in the future.

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Users online (2,176)