[GH-ISSUE #3398] [feature]: Add env variable unset #1137

Closed
opened 2026-03-16 18:49:03 +03:00 by kerem · 7 comments
Owner

Originally created by @rabbittsoup on GitHub (Sep 27, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3398

Is there an existing issue for this?

  • I have searched the existing issues

Summary

I’d like to be able to unset environment variables to help cleanup unused variables in scripts.

pw.env.set(var, null)
or
pw.env.unset(var)

or similar

Why should this be worked on?

In some tests, I create a lot of env variables, and these can make the environment variables difficult to maintain manually. An unset capability allows the script to clean up after itself.

Originally created by @rabbittsoup on GitHub (Sep 27, 2023). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3398 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Summary I’d like to be able to unset environment variables to help cleanup unused variables in scripts. pw.env.set(var, null) or pw.env.unset(var) or similar ### Why should this be worked on? In some tests, I create a lot of env variables, and these can make the environment variables difficult to maintain manually. An unset capability allows the script to clean up after itself.
kerem 2026-03-16 18:49:03 +03:00
  • closed this issue
  • added the
    feature
    label
Author
Owner

@liyasthomas commented on GitHub (Sep 29, 2023):

If you want to set an empty string as the environment value, you could use the following script;

pw.env.set("my_env_variabble","")

Let me know if this is what you're asking.

<!-- gh-comment-id:1740387164 --> @liyasthomas commented on GitHub (Sep 29, 2023): If you want to set an empty string as the environment value, you could use the following script; ``` pw.env.set("my_env_variabble","") ``` Let me know if this is what you're asking.
Author
Owner

@rabbittsoup commented on GitHub (Sep 29, 2023):

No. I want to delete the variable from the environment entirely.

<!-- gh-comment-id:1740456715 --> @rabbittsoup commented on GitHub (Sep 29, 2023): No. I want to delete the variable from the environment entirely.
Author
Owner

@rabbittsoup commented on GitHub (Dec 14, 2023):

Is there anything new I can add to help this request move forward?

<!-- gh-comment-id:1856841663 --> @rabbittsoup commented on GitHub (Dec 14, 2023): Is there anything new I can add to help this request move forward?
Author
Owner

@ajmalmohad commented on GitHub (Dec 15, 2023):

Is there anything new I can add to help this request move forward?

I have raised a PR including this feature in the js-sandbox, which'll work in pre-request and test scripts

<!-- gh-comment-id:1857347004 --> @ajmalmohad commented on GitHub (Dec 15, 2023): > Is there anything new I can add to help this request move forward? I have raised a PR including this feature in the js-sandbox, which'll work in pre-request and test scripts
Author
Owner

@rabbittsoup commented on GitHub (Dec 15, 2023):

Thank you

<!-- gh-comment-id:1858082159 --> @rabbittsoup commented on GitHub (Dec 15, 2023): Thank you
Author
Owner

@liyasthomas commented on GitHub (Feb 2, 2024):

Thanks for your patience and valuable feedback. This feature has been implemented in the latest release.

Closing this ticket as this feature is now available in the recent version. Feel free to reach out if you encounter any further concerns.

<!-- gh-comment-id:1922747312 --> @liyasthomas commented on GitHub (Feb 2, 2024): Thanks for your patience and valuable feedback. This feature has been implemented in the latest release. Closing this ticket as this feature is now available in the recent version. Feel free to reach out if you encounter any further concerns.
Author
Owner

@rabbittsoup commented on GitHub (Feb 3, 2024):

Verified in the wild. Works great! Thank you!

<!-- gh-comment-id:1925101780 --> @rabbittsoup commented on GitHub (Feb 3, 2024): Verified in the wild. Works great! Thank you!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1137
No description provided.