---
url: https://docs.juniper.bot/en/cmd/custom/actions/code.md
description: >-
  Execute Template Code action type is used to execute functions of template
  engine.
---

# Execute Template Code

"Execute Template Code" action type is used to execute functions of template engine.

## How it is useful? { #why }

You can create an action that will execute template code, perform some action and respond with simple success message.

## The behavior and settings { #settings }

The Code to execute is a field where you can enter your code that should be executed.

If your command must respond with specific message, consider using [Send Message](message) action instead or use
[`run`](../../../message-templates/advanced/tags#run) tag to run another action and pass some
[parameters](../../../message-templates/persistence/parameters) into it.

## Example { #example }

For example, you need the command to store an [attribute](../../../message-templates/persistence/member-attributes). To do it, you need:

1. Create a new custom command;
2. Select the "Execute Template Code" action type;
3. In the field "Execute Template Code" write:
   ```template
   {% do member.getAttribute('MyAttribute').update('Code is work!') %}
   ```
4. Save.
