# DestroyVariableByNameAsync Method

## Overloads

| [DestroyVariableByNameAsync(String)](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IApp.DestroyVariableByNameAsync.htm#Qlik_Engine_IApp_DestroyVariableByNameAsync_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`. |
| --- | --- | --- |
| [DestroyVariableByNameAsync(AsyncHandle, String)](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IApp.DestroyVariableByNameAsync.htm#Qlik_Engine_IApp_DestroyVariableByNameAsync_Qlik_Engine_AsyncHandle_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`. |
| [DestroyVariableByNameAsync<T>(AsyncHandle, Func<Response, T>, String)](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IApp.DestroyVariableByNameAsync.htm#Qlik_Engine_IApp_DestroyVariableByNameAsync__1_Qlik_Engine_AsyncHandle_System_Func_Qlik_Engine_Communication_IO_Response___0__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.DestroyVariableByNameAsync.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IApp.DestroyVariableByNameAsync.htm)

## DestroyVariableByNameAsync(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

```

          Task<bool> DestroyVariableByNameAsync([QixName("qName")] string name)
    
  
```

### Parameters

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

### Returns

| Type | Description |
| --- | --- |
| System.Threading.Tasks.Task&lt;System.Boolean&gt; |  |

### Remarks

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

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

## DestroyVariableByNameAsync(AsyncHandle, 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

```

          Task<bool> DestroyVariableByNameAsync(AsyncHandle asyncHandle, [QixName("qName")] string name)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [AsyncHandle](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.AsyncHandle.htm) | asyncHandle | Handle to asynchronous method request |
| System.String | name | Name of the variable. |

### Returns

| Type | Description |
| --- | --- |
| System.Threading.Tasks.Task&lt;System.Boolean&gt; |  |

### Remarks

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

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

## DestroyVariableByNameAsync&lt;T&gt;(AsyncHandle, Func&lt;Response, T&gt;, 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

```
Task<T> DestroyVariableByNameAsync<T>(AsyncHandle asyncHandle, Func<Response, T> onResult, [QixName("qName")] string name)
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [AsyncHandle](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.AsyncHandle.htm) | asyncHandle | Handle to asynchronous method request |
| System.Func&lt;[Response](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.IO.Response.htm), T&gt; | onResult | Continuation function |
| System.String | name | Name of the variable. |

### Returns

| Type | Description |
| --- | --- |
| System.Threading.Tasks.Task&lt;T&gt; |  |

### Type Parameters

| Name | Description |
| --- | --- |
| T |  |

### Remarks

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