---
title: Managing Snippets
description: "##### Add a New Snippet The **Snippets** section allows you to define reusable code snippets for various tasks. **Select the “Snippets” option** from the main menu. **Click on the “+” button** to open the “Add Snippet” page. ![](https://mikrowizard.com/wp-content/uploads/2024/08/1-2-1024x274.png) **Fill in the Snippet Details**: -…"
url: "https://mikrowizard.com/docs/managing-snippets/"
updated: "2024-08-08"
category: "Tasks, Backups & Snippets"
---

# Managing Snippets

##### Add a New Snippet

The **Snippets** section allows you to define reusable code snippets for various tasks.

**Select the “Snippets” option** from the main menu.

**Click on the “+” button** to open the “Add Snippet” page.

![](https://mikrowizard.com/wp-content/uploads/2024/08/1-2-1024x274.png)

**Fill in the Snippet Details**:

- **Name**: Provide a descriptive name for the snippet.

- **Description**: Optionally, add details about the snippet’s usage or purpose.

- **Code**: Enter the code related to the snippet.

**Save the Snippet**: After filling out the information, click the “**Save**” button to store the snippet

![](https://mikrowizard.com/wp-content/uploads/2024/08/add-1.png)

##### Viewing and Managing Snippets

After saving, you will see a list of all snippets that have been created and once you have added snippets, you can view and manage them

- **Options Available for Each Snippet**
  - **Edit**: Click the edit icon next to a snippet to modify its name, description, or code.
  - **Data**: you can monitor the execution details of your snippets:
    1. **View Execution History**: After executing snippets, you can view the time each code was executed, complete with additional details.
    2. **Download Execution Data**: You can download the execution logs in Excel format for further analysis. This file typically includes:
       - **Device ID**: The unique identifier for the device on which the snippet was executed.
       - **IP Address**: The IP address of the device.
       - **Success Status**: Indicates whether the execution was successful or not.
       - **Result**: You can see the output of the executed code.
       - ![](https://mikrowizard.com/wp-content/uploads/2024/08/excel.png)
  - **Execute**: To run the snippet:
    1. Click the “**Execute**” button next to the desired snippet. ![](https://mikrowizard.com/wp-content/uploads/2024/08/key.png)
    2. **Select Devices**: In the pop-up window, choose the group of devices on which you want to execute the snippet.
    3. **Confirm Execution**: Click the “Execute” button to run the code across the selected devices simultaneously.
       - ![](https://mikrowizard.com/wp-content/uploads/2024/08/exec.png)
  - **Delete**: Click the delete icon to permanently remove the snippet from the list.

 **Feedback on Execution**: After executing a snippet, check Data section to ensure it ran successfully on all selected devices.
**Testing and Validation**: Before running snippets on production devices, consider testing them in a controlled environment to prevent unintended changes.
