Feeder variable not getting stored as session variable

Hi All,

I am pretty sure I am wrong somewhere but not able to figure out (after watsing 2 days on this).

val scn = scenario(“RecordedSimulation”)
.feed(patientfeeder) //has ids
.exec(session => {
val pid = session(“ids”).as[String]
session.set(“patientid”,pid) // also tried session.set(“patientid”,session (“ids”).as[String])
print(“value is ${patientid}”) // Won’t print patientid value
println(session (“ids”).as[String]) //print the patientid value
session}).pause(4)

I am not sure why it wouldn’t print, when I give as ${patientid} . I am also trying to use it like ${patientid} in a following request and it won’t resolve there as well.

Any feedback would really help !

Regards,
Maithrie

Please properly read the Session API documentation, in particular the warning :slight_smile:

looks like you have to exe session set first before to print in another exe method . i tested it and it is working ( use below code )
.exec( session => session.set(“patientid”,session(“ids”).as[String])) // name is already available session variable either extract paramter or csv parameter

.exec(session => {
val pid = session(“ids”).as[String]
println(“patientid value is =”+ session(“patientid”).as[String]) // it print patientid value

println(“pid value is =”+pid)// it print pid value

session})