Correlation using regex | Java Gatling

Hi I am getting error – Failed to build request: **No attribute name **
d ‘ID’ is defined.
I am using simple regex chcek and saving it in a variable as below:


I am not defining it anywhere , Can someone help me, I am using JAVA to create Gatling scripts

I am not defining it anywhere

Yes you are, I guarantee. Please double check for things like #{ID}, ${ID} (deprecated syntax) or session.getString("ID").

Can you please send me the syntax to define it
.exec(session → {
return session;
I tried this ,but not working

Please have a look at the documentation:

You’re mixing/confusing them and that can’t work.

Please modify as this one and test again if it helps you

.exec( session -> {
     val name = session.set("ReservationID", "your expecting value");

to use it somewhere else in Gatling session, call:

    yourhttp( #{ReservationID} )

If you are insisting on getString rather than set, then I may misunderstand your use case tho