# Get data from Location header with Flows

**URL:** <https://community.postman.com/t/get-data-from-location-header-with-flows/59572>\
**Category:** Help Hub\
**Tags:** tests, variables, postman-flows\
**Created:** [April 4, 2024, 8:33am UTC](https://community.postman.com/t/get-data-from-location-header-with-flows/59572 "2024-04-04T08:33:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hakkei](https://avatars.discourse-cdn.com/v4/letter/h/848f3c/32.png) [@hakkei](https://community.postman.com/u/hakkei)\
**Post date:** [April 4, 2024, 8:33am UTC](https://community.postman.com/t/get-data-from-location-header-with-flows/59572/1 "2024-04-04T08:33:12Z")

</div>

Hello

I’m testing Flows and I wanted to extract a data from a response header (Location).  
Usually I was doing it in the Test section of the request and saving the data in an environment variable like this:

```auto
let location = pm.response.headers.get("Location").split('?');
let params = location[1].split('&');
let code = params.pop().substring(5);
pm.environment.set("auth_code", code);

```

But it seems that it’s not possible with Flows because I got this warning  
Updating environment variables using flows not supported.  
How would you do in this case

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/f/3/f3481fcc25e4fad41deb00b71ecb5b88176d9867.png)

Thanks

---

<div class="post-metadata">

**Author:** ![flows-daniel](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/flows-daniel/32/25516_2.png) [@flows-daniel](https://community.postman.com/u/flows-daniel)\
**Post date:** [April 4, 2024, 11:25pm UTC](https://community.postman.com/t/get-data-from-location-header-with-flows/59572/2 "2024-04-04T23:25:12Z")

</div>

Hi @hakkei

Updating environment variables aren’t supported in flows.

You can access the headers from the response of a Send Request block by using a Select Block:

 ![Screenshot 2024-04-04 at 4.20.17 PM](https://us1.discourse-cdn.com/getpostman/original/3X/e/0/e0212d2d6ae58f647e419430951823529d3551c2.png)

In your case the Location can be selected and then passed to another block in the flow.

---

<div class="post-metadata">

**Author:** ![hakkei](https://avatars.discourse-cdn.com/v4/letter/h/848f3c/32.png) [@hakkei](https://community.postman.com/u/hakkei)\
**Post date:** [April 5, 2024, 8:01am UTC](https://community.postman.com/t/get-data-from-location-header-with-flows/59572/3 "2024-04-05T08:01:41Z")

</div>

Yes thanks for your answer then I suppose the only way is to work with the Evaluate block and make FQL request to treat the data.

---

<div class="post-metadata">

**Author:** ![flows-daniel](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/flows-daniel/32/25516_2.png) [@flows-daniel](https://community.postman.com/u/flows-daniel)\
**Post date:** [April 5, 2024, 3:49pm UTC](https://community.postman.com/t/get-data-from-location-header-with-flows/59572/4 "2024-04-05T15:49:29Z")

</div>

@hakkei

For now yes, but we will have an alternative coming very soon.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [May 5, 2024, 3:50pm UTC](https://community.postman.com/t/get-data-from-location-header-with-flows/59572/5 "2024-05-05T15:50:13Z")

</div>

Closed on May 5, 2024, 3:50pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
