# DestroyVariableByName Method

## Overloads

| [DestroyVariableByName(String)](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IApp.DestroyVariableByName.htm#Qlik_Engine_IApp_DestroyVariableByName_System_String_) |  | Removes a variable.<br><br>Script-defined variables cannot be removed using the `DestroyVariableById method` or the `DestroyVariableByName method`. For more information, see `Remove a variable`. |
| --- | --- | --- |

[](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IApp.DestroyVariableByName.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IApp.DestroyVariableByName.htm)

## DestroyVariableByName(String)

Removes a variable.

Script-defined variables cannot be removed using the `DestroyVariableById method` or the `DestroyVariableByName method`. For more information, see `Remove a variable`.

### Declaration

```

          bool DestroyVariableByName([QixName("qName")] string name)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.String | name | Name of the variable. |

### Returns

| Type | Description |
| --- | --- |
| System.Boolean |  |

### Remarks

The operation is successful if **qSuccess** is set to true.