# Random value generator for same variable in json file

**URL:** <https://community.gatling.io/t/random-value-generator-for-same-variable-in-json-file/4143>\
**Category:** Gatling (Open-Source)\
**Created:** [January 26, 2018, 3:09am UTC](https://community.gatling.io/t/random-value-generator-for-same-variable-in-json-file/4143 "2018-01-26T03:09:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankita\_chandel](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@ankita\_chandel](https://community.gatling.io/u/ankita_chandel)\
**Post date:** [January 26, 2018, 3:09am UTC](https://community.gatling.io/t/random-value-generator-for-same-variable-in-json-file/4143/1 "2018-01-26T03:09:01Z")

</div>

Hello,

Is there a way to generate random values inside the session for the same parameter.

Ex json file-

{  
“age”: “${age}”,  
},  
{  
“age”: “${age}”,  
}

val ageFeeder = Iterator.continually(Map (“age” → (0 + ThreadLocalRandom.current().nextInt(100 - 0) + 1).toString () ) )

val scn = scenario(“test”)  
.exec(feed(ageFeeder))  
.exec(session =\> {  
//// code to read the file using ElFileBody which replaces ${age} with randomly generated age  
})

I want to generate random values for the number of times we are calling ${age} in the file.
