Get data from Location header with Flows

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:

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

Thanks

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:

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

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.

@hakkei

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

1 Like

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