Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

256
Vistas
Pre-Request Script scopes in Postman

I have collection named "Auth" with pre-request script where I define JavaScript variable "token", and some JavaScript general functions, which I want to use in my inner pre-request scripts.

Within "Auth" collection I have folder name "Tests" with own pre-request script. I expected both scripts to be merged but when I try to use "token" JavaScript variable from "Auth" collection I get an error:

ReferenceError: currentAccessToken is not defined

How to access JavaScript variables (and JavaScript functions) from collection pre-request script in inner folder pre-request script?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Postman has different variable scopes, which you would need to use, eg:

pm.globals.set("variable_key", "variable_value");
pm.globals.get("variable_key");

pm.collectionVariables.set("variable_key", "variable_value");
pm.collectionVariables.get("variable_key");

pm.environment.set("variable_key", "variable_value");
pm.environment.get("variable_key");

Please check out Using variables for more details.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda