Delete variable from variable set using API

brendan.holmes's Avatar


13 Jan, 2018 07:07 PM


Has anyone ever deleted a variable from variable set using API? I know there's a variableset.Variables.Add method, but I can't find any documentation about other methods and I have no access the octopus cli.

Many thanks,

  1. Support Staff 1 Posted by Shannon Lewis on 15 Jan, 2018 05:02 AM

    Shannon Lewis's Avatar

    Hi Brendan,

    Thanks for getting in touch. The VariableSet's Variables is an IList, so it has an Add and a Remove method. The Remove requires an object though, so you'd have to look through the list for the variable that has the name and ScopeSpecification that you're after and then pass that object instance to the Remove method.

    For completeness, there is also a RemoveAt but I suspect a remove based on index position won't be what you're after.

    Hope that helps and if I can assist further just let me know.


Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac