---
title: Actions: Step by Step
slug: neurons/help/en_us/actions-step-by-step
createdAt: 2026-11-05T08:02:07.158Z
---

This topic contains step by step instructions for creating Edge Intelligence actions and linking them to a query or an alert. It also explains the use of action variables, placeholders and using query data in your action.

## Prerequisites

- Ivanti Neurons Agent installed on endpoints you want to query or for which you want to set alerts. See [Ivanti Neurons Agent](https://docs.ivanti.com/neurons/help/en_us/agents).
- Endpoints must have a Policy that has the **Capability** **Edge Intelligence** enabled. See [Agent Policy Capabilities](https://docs.ivanti.com/neurons/help/en_us/agent-policy-capabilities) in the Policy.
- A role with permissions to configure actions, perform actions and set alerts for Edge Intelligence. See [Access Control](https://docs.ivanti.com/neurons/help/en_us/access-control#Roles).

## Create a custom query action from the Edge Intelligence Configuration panel

In this example you will add an action to the **Service State** query to restart a service. The action uses a PowerShell script, with a placeholder for information retrieved by the query. After the service has been restarted, the user will be notified.

1. Go to **Insights > Edge Intelligence**, and click :inlineImage[]{src="https://api.archbee.com/api/optimize/9rfvxhrv8FA-8bxcK2IRv/O6Ug_IzYG4BW5vVFT1YQf_real-time-icon-settings.png" alt="Settings icon" caption size="10" width="35" height="35"} in the top-right corner of the page.
   The **Edge Intelligence Configuration** panel appears.
2. On the **Actions** tab select **Add new action**.
   The **New action** page opens inside the panel.
   1. Specify a **Name** for the action, for example *Restart service*.
   2. In the **Variables** section select **Add new variable**.
      The **New variable** panel appears.
      1. Specify a **Name** for the variable, for example *ServiceName*.

         :::hint{type="info"}
         For illustration purposes, the specified names for the variables in this example are identical to the auto-generated variables in the next example. This is not a requirement.
         :::
      2. Do not specify a **Value**. This will be provided by the query.
      3. Leave the option **Public variable** enabled. This allows the value of the variable to be set during execution of the action.
      4. Click **Save**.
         The variable is saved and the **New variable** panel closes.
   3. In the **Tasks** section select **Add new task**.
      The **New task** panel appears.
      1. Specify a **Name** for the task, for example Restart service.
      2. In the bottom section click *Select* to see a list of available tasks. Select **Execute PowerShell**.
      3. In the **Script** field that appears, insert your (draft) PowerShell script.
         For this example:

         ```powershell
         $ServiceName = "$(var.placeholder)"
         Restart-Service-Name $ServiceName-Force-ErrorAction Stop
         ```

         :::hint{type="success"}
         If you are confident about the exact spelling of the text that should replace `$(var.placeholder)`, you can directly type or paste the final version into the **Script** field. In that case, you can skip ahead to step vi.
         :::
      4. From the **Available Placeholders** section (below the **Script** field) copy `$(action.ServiceName)` using :inlineImage[]{src="https://api.archbee.com/api/optimize/9rfvxhrv8FA-8bxcK2IRv/UyLTaDp_F2GHOBnLscsZD_real-time-icon-copy.png" alt="Copy to clipboard" caption="Copy to clipboard" size="10" width="42" height="42"}. This is the variable ServiceName you created in step 2b.
      5. In the **Script** field replace `$(var.placeholder)` with the placeholder you copied in step iv.
         The script should now look like this:

         ```powershell
         $ServiceName = "$(action.ServiceName)"
         Restart-Service-Name $ServiceName-Force-ErrorAction Stop
         ```
      6. Click **Save**.
         The task is saved and the **New task** panel closes.
   4. In the **Tasks** section select **Add new task** again.
      The **New task** panel appears.
      1. Specify a **Name** for the task, for example Notify end user.
      2. In the bottom section click *Select* to see a list of available tasks. Select **Notify user**.
      3. In the **Subject** field that appears, type (for example) Successfully restarted service: $(action.ServiceName).

         :::hint{type="success"}
         The placeholders are again listed below the task-specific fields of the **New task** panel, in this case the **Subject** and **Message** fields.
         :::
      4. In the **Message** field type the body of the message you want to send to the user. For example:
         *Dear user,*
         *The following service was successfully restarted:*
         *$(action.ServiceName)*
         *Best regards,*
         *The IT Team*
      5. Click **Save**.
         The task is saved and the **New task** panel closes.

:::Paragraph{indent="3"}
The result should look like the image below.
:::

::Image[]{src="https://api.archbee.com/api/optimize/9rfvxhrv8FA-8bxcK2IRv/taJeRcXhgbg-CD_4Jksa3_real-time-config-action-result.png" alt="Result of the configuration. Two tasks are listed in the Tasks section and three variables in the Variables section." position="flex-start" size="85" width="594" height="509" initialPath="Images/real-time-config-action-result.png" githubPath="neurons_05nov/Images/real-time-config-action-result.png" showCaption="false" indent="3"}

:::Paragraph{listStyleType="decimal" listStart="5" indent="2"}
Click **Save**.
The action is saved and the **New action** page closes.
:::

3. On the **Queries** tab of the **Edge Intelligence Configuration** panel find the **Service State** query and click on its name.
   The details page for the query opens inside the panel, displaying an overview of linked actions.
   1. In the **Actions** section select **Add action**.
      The **Add action** panel opens.
   2. From the drop-down select **Restart service**, the name of the action you created in step 2a-e.
      The **Action data** section (listing the variables you created in step 2b) and the **Available Placeholders** section (listing data retrieved by the query) appear.

      1. In the **Action** section, for Name:
         - at **Type** select **Use the following value:**
         - at **Value** specify `$(query.name)`, the placeholder for ServiceName.

      :::hint{type="success"}
      You can copy a placeholder by using the :inlineImage[]{src="https://api.archbee.com/api/optimize/9rfvxhrv8FA-8bxcK2IRv/UyLTaDp_F2GHOBnLscsZD_real-time-icon-copy.png" alt="Copy" caption="Copy" size="10" width="42" height="42"} icon displayed next to the placeholder definition.
      :::
   3. Click **Add** to save your changes.
      The **Add action** panel closes.
4. Click **Close**.
   The **Edge Intelligence Configuration** panel closes.

The Restart service action is now available for use:

1. Run the **Service State** query.
2. From the list view of the query results find the line with the desired **Computer Name** and **Service Name**.
   Optionally, you can use filters and/or parameters to do this.
3. Open the options menu ( :inlineImage[]{src="https://api.archbee.com/api/optimize/9rfvxhrv8FA-8bxcK2IRv/fPlgNYuAW6u8IGaM7cIPY_general-options-menu.png" alt="Options menu icon" caption size="10" width="4" height="12"} ) for the selected line and select **Restart Service**.
   1. The action restarts the service and the **Service State** query results are updated.
   2. The notification you created in step 2d is displayed to the end user.

:::hint{type="danger"}
If you select the query-level actions menu (highlighted in **red** in the following image) instead of the record-level actions menu (highlighted in **green**), Edge Intelligence applies the action to all records in the query results. Depending on your query parameters, this could result in every service on every device in your environment being restarted. Proceed with caution when using *query-level* actions and always validate newly created custom actions in a test or lab environment before deploying them to production.
:::

![](https://api.archbee.com/api/optimize/9rfvxhrv8FA-8bxcK2IRv/WsTuIGbAGhfDOtwq-HYwj_service-state-edge-intelligence.png)

## Create a Quick Action using the 'Manage actions for query' panel

In this example you will add a similar action as in the example [Create a custom query action from the Edge Intelligence Configuration panel](https://docs.ivanti.com/neurons/help/en_us/actions-step-by-step#CreateFromConfPanel), but as a Quick Action. This automates some of the configuration steps for you.

1. Go to **Insights > Edge Intelligence**, and open the **Service State** query (in the **Inventory** category).
   The **Service State** query widget appears.
2. Use the toggle :inlineImage[]{src="https://api.archbee.com/api/optimize/9rfvxhrv8FA-8bxcK2IRv/4VbgeWLBndFVO0KqiJQwC_real-time-icon-toggle-view.png" alt="Toggle view icon" caption size="10" width="100" height="35"} to switch to the list view.
3. Open the options menu ( :inlineImage[]{src="https://api.archbee.com/api/optimize/9rfvxhrv8FA-8bxcK2IRv/fPlgNYuAW6u8IGaM7cIPY_general-options-menu.png" alt="Options menu icon" caption size="10" width="4" height="12"} ) and select **Manage**.
   The **Manage actions for Service State query** panel appears, displaying a list of linked actions.
4. Select **Create a Quick Action**.
   The **Create a Quick Action** panel appears.
   1. Specify an **Action name**, for example *Restart Service Quick Action*.
   2. Select the **Execute Powershell** task.
      The selected task is added under **Tasks**, and additional configuration fields for the task appear.
      1. In the **Script** field, insert your (draft) PowerShell script.
         For this example:

         ```powershell
         $ServiceName = "$(var.placeholder)'"
         Restart-Service-Name $ServiceName-Force-ErrorAction Stop
         ```
      2. In the **Script** field, select `$(var.placeholder)` and click on the placeholder **Program**, under **Available Placeholders**.
         The placeholder is inserted and the script should now look like this:

         ```powershell
         $ServiceName ="$(query.name)"
         Restart-Service-Name $ServiceName-Force-ErrorAction Stop
         ```

         :::hint{type="success"}
         You can insert placeholders as you type the script.
         :::
   3. Select **Add another task**.
      The list of available tasks appears.
   4. Select the **Notify user** task.
      The selected task is added under **Tasks**, and additional configuration fields for the task appear.
      1. Specify a **Subject** and a **Message** for the notification. You can use placeholders in these fields.
   5. Click **Save**.
      The **Create a quick action** panel closes and the **Manage actions for Service State query** panel becomes visible again. Your new action is listed under **Linked actions**.
5. Click **Close**.
   The **Manage actions for Service State query** panel closes.

The *Restart service Quick Action* action is now available for use.
