# DestroyVariableByIdAsync Method

## Overloads

| [DestroyVariableByIdAsync(String)](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/NetSDKAPIref/Content/Qlik.Engine.App.DestroyVariableByIdAsync.htm#Qlik_Engine_App_DestroyVariableByIdAsync_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`. |
| --- | --- | --- |
| [DestroyVariableByIdAsync(AsyncHandle, String)](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/NetSDKAPIref/Content/Qlik.Engine.App.DestroyVariableByIdAsync.htm#Qlik_Engine_App_DestroyVariableByIdAsync_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`. |
| [DestroyVariableByIdAsync<T>(AsyncHandle, Func<Response, T>, String)](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/NetSDKAPIref/Content/Qlik.Engine.App.DestroyVariableByIdAsync.htm#Qlik_Engine_App_DestroyVariableByIdAsync__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.App.DestroyVariableByIdAsync.htm) [](https://help.qlik.com/en-US/sense-developer/Subsystems/NetSDKAPIref/Content/Qlik.Engine.App.DestroyVariableByIdAsync.htm)

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

```

          public Task<bool> DestroyVariableByIdAsync([QixName("qId")] string id)
    
  
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.String | id | Identifier of the variable. |

### Returns

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

### Implements

[IApp.DestroyVariableByIdAsync(String)](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IApp.DestroyVariableByIdAsync.htm#Qlik_Engine_IApp_DestroyVariableByIdAsync_System_String_)

### Remarks

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

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

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

```

          public Task<bool> DestroyVariableByIdAsync(AsyncHandle asyncHandle, [QixName("qId")] string id)
    
  
```

### Parameters

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

### Returns

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

### Implements

[IApp.DestroyVariableByIdAsync(AsyncHandle, String)](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IApp.DestroyVariableByIdAsync.htm#Qlik_Engine_IApp_DestroyVariableByIdAsync_Qlik_Engine_AsyncHandle_System_String_)

### Remarks

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

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

## DestroyVariableByIdAsync&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

```
public Task<T> DestroyVariableByIdAsync<T>(AsyncHandle asyncHandle, Func<Response, T> onResult, [QixName("qId")] string id)
```

### Parameters

| Type | Name | Description |
| --- | --- | --- |
| [AsyncHandle](https://help.qlik.com/en-US/sense-developer/November2024/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/November2024/Subsystems/NetSDKAPIref/Content/Qlik.Engine.Communication.IO.Response.htm), T&gt; | onResult | Continuation function |
| System.String | id | Identifier of the variable. |

### Returns

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

### Type Parameters

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

### Implements

[IApp.DestroyVariableByIdAsync<T>(AsyncHandle, Func<Response, T>, String)](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/NetSDKAPIref/Content/Qlik.Engine.IApp.DestroyVariableByIdAsync.htm#Qlik_Engine_IApp_DestroyVariableByIdAsync__1_Qlik_Engine_AsyncHandle_System_Func_Qlik_Engine_Communication_IO_Response___0__System_String_)

### Remarks

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