Skip to content

Improvements for Insomnia Pre-request Script Overview documentation #245

Open
@bartoszWesolowski

Description

Code of Conduct

What article on docs.insomnia.rest is affected?

https://docs.insomnia.rest/insomnia/pre-request-script

What part(s) of the article would you like to see updated?

Variables Manipulation

Additional information

Hello,

I am writing some scripts for Insomnia collections and found it difficult to understand how variables are evaluated. I would be great to include additional info in the documentation, for example:

  1. There are multiple objects that I can use to get variables: insomnia.environment, insomnia.baseEnvironment, insomnia.variables - it would be great to have an implicit documentation that would state which object reference which variables (base configuration, collection environment, folder variables).
  2. We have multiple levels of configuration, it would be grate do have documentation that states how they are evaluated, is sub-config json merged with the parent config or it override all? Same for collection config and sub configs, directory variables.
  3. How to access folder variables and how are they merged in the folder hierarchy. I have collection env with variable x=col-env-value, and I also added a folder, on which I created environment variable x=dir-env-value. How this folder level variable can be accessed in script? Script is on parent folder, variables on child folder.

Best regards,
Bartek

Code of Conduct and Community Expectations

  • I agree to follow this project's Code of Conduct
  • I agree to abide by the Community Expectations

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions