# assign

The assign parameter to many [NATS ](https://docs.toomuchmedia.com/additional-resources/common-terms#nats)functions lets you change output variable names. For example, the NATS template function, [nats\_decode](https://docs.toomuchmedia.com/nats-admin/skins-and-templates/further-reading/template-functions/nats_decode), 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}
