How to put variable in http body

I save necessary information in "identity_id_B" and need to send it in the next request body.
How can i save this info in variable?
Thanks in advance

 .exec(http("Create id user B")
 .body(StringBody(session => "...")).asJSON

 exec(http("Send invite")
  .body(StringBody(session => "{\"invitee\":\"" + identity_id_B!! + "\",\"message\":\user B\"}")).asJSON

What you are looking for is session variables and expressions…

.body( StringBody( “”"{“invitee”:"${identity_id_B}",“message”:“user B”}""" ) )

Unfottunately, in this case :.body( StringBody( “”"{“invitee”:"${identity_id_B}",“message”:“user B”}""" ) )
i have REQUEST BODY: null

in this one: .body(StringBody( session => {"“invitee”:"${identity_id_B}",“message”:“user B”"})).asJSON
REQUEST BODY: “invitee”:"${identity_id_B}",“message”:"user B"

maybe i need to create some session variable?

The first request is supposed to be creating the session variable. But you are missing a leading dot on your second exec, which means it is not being chained properly. Add the missing “.” and try again.

exec(http("Send invite")
 .body(StringBody( session => {"\"invitee\":\"${identity_id_B}\",\"message\":\"user B\""})).asJSON

Its ok in scenario, i missed dot in example(
everything work correctly, but i cant to transfer the value to a variable
I think that its necessary to create a session variable
All i need is to put my saved previously value into body.
But I dont know how

Re-read my first reply.