# Generate One-Time-Password Code Data Flow Template

![generateonetimepass.png](https://1191388742-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhOn9CLWoV9VfJeM5EDAa%2Fuploads%2Fgit-blob-68ea992441efd5aeb814baa93f3fca657151e832%2Fgenerate-one-time-password-code-data-flow-template-v1715-0.png?alt=media)

### Overview

This [Data Flow template](../building-apps/kitcloud/data-flow-templates) has three [Data Operations](../data-operations/data-operation-overview) that allow app builders to generate a code with a specific length to use as a one-time password by passing data through this Data Flow.

In [Connection Builder](../studio/builder-bar/connection-builder), Data Flow templates can be found with pre-populated sample data. However, to meet the requirements of their [Journey](https://docs.airkit.ai/?q=the-journey-model), app builders should perform the necessary adjustments, such as adding other Data Ops.

### Data Operations

This Data Flow contains five main parts:

#### Inputs

The Start pane keeps track of the inputs required by the Data Flow.&#x20;

* Sample Inputs:
  * length [Variable](../working-with-data/variable-scopes) of type [Number](../variable-data-types/the-number-variable-data-type)

#### [Transform Data Operation](../data-operations/the-transform-data-operation)

* Transform Expression: Airscript expression to generate the max value based on the length of the input.
* Output Format: Variable
* Type: Number
* Run Results: max output Variable of type Number that is automatically created to hold the results of this Operation

#### Transform Data Operation

* Transform Expression: Airscript expression to assort a number between 0 and the maximum value defined by the input.
* Output Format: Variable
* Type: [Text](../variable-data-types/the-text-variable-data-type)
* Run Results: random output Variable of type Text that is automatically created to hold the results of this Operation

#### Transform Data Operation

* Transform Expression: Airscript expression to make sure the assorted number has the length indicated in the first Data Op. If the number is lower, zeros will be added to the front.
* Output Format: Variable
* Type: Text
* Run Results: code output Variable of type Text that is automatically created to hold the results of this Operation.

#### Output

The End step is where variables from the Data Flow can be used as an output.

* Sample Return Value: code of type Text

### Use Cases

* Allow app builders to generate a variable length code to use as OTP.
