# Dynamic Token Creation in Guardian Policies using UI

For cases, when it is not known “a priori” how many different tokens will be created by the policy during its execution, the following facilities of CreateTokenBlock could be used to configure dynamic creation of the tokens triggered by policy events. Note that when this approach is used, each token is created and used for minting instances of, on the basis of MRVs produced by/for a specific device, which was represented by a VC passed into the CreateTokenBlock. In other words, the VC of the device becomes 1-to-1 linked with such token ID and later, when Issue Requests are delivered to the MintBlock, the system recognises the device these requests are produced for and mints instances of the corresponding tokens.

## To configure dynamic token creation:

1. In template configuration set **wipeContractId** property:

![Wipe contract property in token template configuration](/files/NPSR1OkeBJaghcCsKuTp)

2. In template configuration populate variables for token name and token symbol.

**Examples:**

* tokenName: Device\_Token\_**${document.credentialSubject.0.id}**
* tokenSymbol: DT\_**${index}**

**${index}** - is predefined variable and allows users to set up the additional variable part of the token number in tokenName or tokenSymbol dynamically at run-time. The value is auto-incremented witch each token mint so users can later differentiate such tokens if they are automatically created.

3. Set **autorun** property in the createTokenBlock - block will automatically create a token without requiring user’s actions (no manual approval will be required).

**Requirements:**

* **defaultActive** should be false (preventing showing UI for createTokenBlock)
* All fields in token template must be filled in

![Autorun property in createTokenBlock configuration](/files/pM6SHKLEM69mHiPtEtwO)

4. Populate **useTemplate** property in the tokenActionBlock, tokenConfirmationBlock

![useTemplate property in tokenActionBlock configuration](/files/CBsJXIqefzfRFAKmx0Fx)


---

# 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://guardian.hedera.com/guardian-dev/guardian/tokens/dynamic-token-creation-in-policies/dynamic-token-creation-in-guardian-policies-using-ui.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.
