# Not able use the value which is obtained from the previous response.

**URL:** <https://community.gatling.io/t/not-able-use-the-value-which-is-obtained-from-the-previous-response/5214>\
**Category:** Gatling (Open-Source)\
**Created:** [August 30, 2019, 10:37am UTC](https://community.gatling.io/t/not-able-use-the-value-which-is-obtained-from-the-previous-response/5214 "2019-08-30T10:37:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Madhu\_Br](https://avatars.discourse-cdn.com/v4/letter/m/ecb155/32.png) [@Madhu\_Br](https://community.gatling.io/u/Madhu_Br)\
**Post date:** [August 30, 2019, 10:37am UTC](https://community.gatling.io/t/not-able-use-the-value-which-is-obtained-from-the-previous-response/5214/1 "2019-08-30T10:37:48Z")

</div>

I am new to gatling, please bear me if this is a simple mistake.  
val scn = scenario(“GetProjectIdGenerateReport”)  
.exec(http(“request\_0”)  
.get("/codeinsight/api/project/id?projectName=eporta")  
.headers(headers\_0))

**.check(regex(":(?[0-9]+)").saveAs(“Project1”))) -------\> Here Im grepping and storing the value from the response.**

})  
.exec(http(“request\_1”)  
.get(s"/codeinsight/api/project/generateReport?projectId= **${Project1}** &reportType=PROJECT") → **When im trying reuse, it says variable not declared/ Not found.**  
.headers(headers\_0))  
})

can someone help me with this, Thanks in Advance

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [August 30, 2019, 3:59pm UTC](https://community.gatling.io/t/not-able-use-the-value-which-is-obtained-from-the-previous-response/5214/2 "2019-08-30T15:59:23Z")

</div>

Remove the « s » IntelliJ prepended to your String.

---

<div class="post-metadata">

**Author:** ![Madhu\_Br](https://avatars.discourse-cdn.com/v4/letter/m/ecb155/32.png) [@Madhu\_Br](https://community.gatling.io/u/Madhu_Br)\
**Post date:** [September 3, 2019, 7:16am UTC](https://community.gatling.io/t/not-able-use-the-value-which-is-obtained-from-the-previous-response/5214/3 "2019-09-03T07:16:13Z")

</div>

I removed that and tried again, It still did not work
