# assign

The assign parameter to many [NATS ](/additional-resources/common-terms.md#nats)functions lets you change output variable names. For example, the NATS template function, [nats\_decode](/nats-admin/skins-and-templates/further-reading/template-functions/nats_decode.md), creates the following variable by default:

* {$encoded}

Unfortunately, if you already have a Smarty variable named $encoded when you call nats\_encode, the new value overwrites the old value. We designed assign to solve this problem. Call nats\_encode with an argument to the assign parameter to have its output placed in the variable named by your argument.&#x20;

For example: the following code,

* {nats\_encode assign="my\_variable"}

Puts the output in,

* {$my\_variable}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-function-parameters/assign.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
