# Pre request script

This feature is available only for vREST NG Pro Edition. Although, you may use the utility methods to configure any property for the test case. But if you would like to use those generated values during response validation then you may use the Template Data tab for this purpose.

Template Data can also be used to set the data for the Loop Source field using the $init key in this tab.

# Usage 1: Use Template Data tab to generate some values for the test case

Suppose we would like to generate a random string for the test case and we would like to use that generated string in the request parameter and during response validation. Then we may define the Template Data as shown in the figure below:

Now, you may use the name field defined in this tab in setting up the test case request and during the response validation using {{$data.name}}.

# Usage 2: Use Template Data tab to initialize the array for setting up the loop Source property

And if you would like to initialize the test case iteration data, then you may set it using a special property $init inside the Template Data tab.

Now you may set the loop source property as {{$data.$init.records}}