# Defining walkthrough Action

### Creating Actions

Use **Actions** to automatically perform certain actions for the employee.

{% hint style="danger" %}
Note that Adopt executes Actions on behalf of the user, in their own session. Any resulting outcomes directly affect the user.

As a security precaution, ensure that you set proper permissions for guide creation to prevent misuse of actions or outcomes that could be detrimental to users.
{% endhint %}

After [accessing Adopt Editor](https://docs.nexthink.com/platform/user-guide/adopt/guide-content-development-from-in-app-adopt-editor/..#accessing-specific-guide-in-adopt-editor) for Walkthroughs, from the **+** menu:

1. Select **Action** to create one.
2. When associated with an element, set one of the following **Action types**:
   * **Click** interacts with the associated element. When an employee reaches this part of the Walkthrough, you can create a Click Action rather than instructing them to navigate to a different page or interact with an element.
   * **Focus** switches the active focus to the associated element, provided it is a text input field, block of text, or a drop-down menu. You can create Focus Actions that bring important page elements to the employee's attention during a walkthrough.
   * **Store value:** Stores the value the user inputs or selects from a field in a variable.
   * **Input value:** Inputs a previously stored variable from an input field or text area.
     * **Static value:** Allows you to define a hardcoded value that will not change.
     * **Stored value:** Allows you to select from a list of stored, variable values.
   * **Select value:** Inputs a previously stored variable from a drop-down option.

You can also preview the element value that will be stored when the step is triggered and select a variable name for later use.

{% hint style="warning" %}
When choosing **Click** as the **Action type**, you may need to choose a different **Click action method** to ensure the guide action interacts correctly with a specific page element.
{% endhint %}

<details>

<summary>Choosing different Click action methods</summary>

When selecting **Click** as **Action type**, the system defaults to **Auto,** which relies on the best method listed below to ensure the web application records the employee's click-type action.

However, in some cases, you may need to select a specific **Click action method**:

* **Auto** click automatically uses the best strategy (from the list below) based on page element type—button, select list or others.
* **Element click** works best for buttons.
  * This method uses `element.click();` .
* **Element event dispatch** works for most elements—**mousedown** & click events.
  * This method triggers `element.dispatchEvent(new MouseEvent(eventName, { bubbles: true, clientX: x, clientY: y }));` .
* **Element show picker** works best for date pickers, colour pickers, select lists, etc.
  * This method uses `element.showpicker();` .

</details>

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-cf6744282add4a27f5ca9c3d2ca7411b1cfbeaef%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>
