How to update variables to manage JWT in postman flows

Hi, i’m currently working on a workflow where I need 2 different roles to perform tasks. when I run the request of the first role I store the access token (JWT) in a variable:

image

After some other operations, I need to login with the other user, but it’s not possible to update the variable “Access Token” because postman treats it as constant.

Currently i’m creating a second variable with the Access token and works fine, but I’m looking for a better approach to only use one variable.

image

I tried using the accessToken extracted from body and pass directly to another request, but creates a mess with all the wires connected from one source.

PD: If exists a better approach to extract token and set at variable (instead of my current flow of body → accessToken → Create variable) I’ll glad to receive suggestions.

Hi @davidaraya

Welcome to the forums!

What you mentioned are the two ways of doing this today. Either using two variables or creating the connections manually.

There is an easier way of extracting the token, instead of using two select blocks you can use one and do: body.accessToken. If you run the request first, it should even pop up a menu to chose it in the select block itself.

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