Skip to main content

Notifications

Power Platform Community / Forums / Building Flows / Parse headers returned...
Building Flows
Answered

Parse headers returned from http action?

Posted on by 6

I have an HTTP request which processes just fine and gets back a body, headers, and response code value... however I would like to get the value of a specific header key (the value in the "location" key in my case) for use in a subsequent flow action... 

 

Is this possible? I see the Headers response object, but i have no idea how to parse that to just get the value i am looking for... 

 

Thanks

  • Re: Parse headers returned from http action?

    InvalidTemplate. Unable to process template language expressions in action 'Initialize_variable_2' inputs at line '1' and column '2200': 'The template language expression 'outputs('HTTP')['headers']['location']' cannot be evaluated because property 'location' doesn't exist, available properties are 'Pragma, Cache-Control, Date, Set-Cookie, X-Frame-Options, Content-Length, Content-Type, Expires'. Please see https://aka.ms/logicexpressions for usage details.'.

     

    However when i passed the outputs('HTTP')['headers']['X-Frame-Options']. I am getting the proper result.

  • Racca Profile Picture
    Racca 4 on at
    Re: Parse headers returned from http action?

    Is it possibile get the "Request header"?
    This is the response header.
    Thanks

  • KarmaPoliceT2 Profile Picture
    KarmaPoliceT2 6 on at
    Re: Parse headers returned from http action?

    This worked wonderfully... i wasn't aware of the outputs expression's '?' variable parsing capabilities... thanks!

  • Verified answer
    v-xida-msft Profile Picture
    v-xida-msft on at
    Re: Parse headers returned from http action?

    Hi @KarmaPoliceT2,

     

    Could you please share a screenshot of your flow's configuration?

    Further, could you please share a bit more about your Headers response object?

    I have made a test on my side and the flow works well. Please take a try with the following workaround:

     

    14.JPG

    The flow works successfully as below:

     15.JPG

    In your scenario, please type the following expression:

    outputs('HTTP')['headers']?['location']

     

    Best regards,

    Kris 

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,714

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard

Featured topics